Skip to content
Permalink
Browse files
JCLOUDS-1225: Address Guava 18 Objects changes
Fixed with:

find -name \*.java | xargs sed -i 's/Objects.[Tt]oStringHelper/More&/g'
find -name \*.java | xargs sed -i 's/Objects.firstNonNull/More&/g'
find -name \*.java | xargs sed -i 's/^\(import com.google.common.base.\)\(Objects.*\)/\1More\2\n\1\2/g'
find -name \*.java | xargs java -jar google-java-format-1.3-all-deps.jar -i --fix-imports-only --skip-sorting-imports
  • Loading branch information
gaul committed Aug 25, 2017
1 parent 6965d70 commit 041cd8d2f775ac409ccb162c423b503ffa58b0a8
Showing 48 changed files with 120 additions and 78 deletions.
@@ -26,7 +26,7 @@
import org.jclouds.openstack.v2_0.domain.Resource;

import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.base.MoreObjects.ToStringHelper;
import com.google.common.base.Optional;

/**
@@ -29,7 +29,7 @@
import org.jclouds.openstack.v2_0.domain.Link;

import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.base.MoreObjects.ToStringHelper;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableMap;

@@ -17,6 +17,7 @@

package org.jclouds.openstack.marconi.v1.domain;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

import javax.inject.Named;
@@ -79,8 +80,8 @@ public boolean equals(Object obj) {
&& Objects.equal(this.id, that.id);
}

protected Objects.ToStringHelper string() {
return Objects.toStringHelper(this)
protected MoreObjects.ToStringHelper string() {
return MoreObjects.toStringHelper(this)
.add("age", age).add("created", created).add("id", id);
}

@@ -17,6 +17,7 @@

package org.jclouds.openstack.marconi.v1.domain;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import org.jclouds.javax.annotation.Nullable;
@@ -83,8 +84,8 @@ public boolean equals(Object obj) {
return Objects.equal(this.id, that.id);
}

protected Objects.ToStringHelper string() {
return Objects.toStringHelper(this)
protected MoreObjects.ToStringHelper string() {
return MoreObjects.toStringHelper(this)
.add("id", id).add("ttl", ttl).add("age", age).add("messages", messages);
}

@@ -17,6 +17,7 @@

package org.jclouds.openstack.marconi.v1.domain;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import org.jclouds.domain.JsonBall;

@@ -62,8 +63,8 @@ public boolean equals(Object obj) {
return Objects.equal(this.ttl, that.ttl) && Objects.equal(this.body, that.body);
}

protected Objects.ToStringHelper string() {
return Objects.toStringHelper(this)
protected MoreObjects.ToStringHelper string() {
return MoreObjects.toStringHelper(this)
.add("ttl", ttl).add("body", body);
}

@@ -17,6 +17,7 @@

package org.jclouds.openstack.marconi.v1.domain;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Optional;
import org.jclouds.javax.annotation.Nullable;
@@ -90,8 +91,8 @@ public boolean equals(Object obj) {
return Objects.equal(this.id, that.id);
}

protected Objects.ToStringHelper string() {
return Objects.toStringHelper(this).omitNullValues()
protected MoreObjects.ToStringHelper string() {
return MoreObjects.toStringHelper(this).omitNullValues()
.add("id", id).add("ttl", ttl).add("body", body).add("age", age).add("claimId", claimId);
}

@@ -17,6 +17,7 @@

package org.jclouds.openstack.marconi.v1.domain;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

import javax.inject.Named;
@@ -60,8 +61,8 @@ public boolean equals(Object obj) {
return Objects.equal(this.messageIds, that.messageIds);
}

protected Objects.ToStringHelper string() {
return Objects.toStringHelper(this).add("messageIds", messageIds);
protected MoreObjects.ToStringHelper string() {
return MoreObjects.toStringHelper(this).add("messageIds", messageIds);
}

@Override
@@ -17,6 +17,7 @@

package org.jclouds.openstack.marconi.v1.domain;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Optional;
import org.jclouds.javax.annotation.Nullable;
@@ -97,8 +98,8 @@ public boolean equals(Object obj) {
&& Objects.equal(this.newest, that.newest);
}

protected Objects.ToStringHelper string() {
return Objects.toStringHelper(this).omitNullValues()
protected MoreObjects.ToStringHelper string() {
return MoreObjects.toStringHelper(this).omitNullValues()
.add("claimed", claimed).add("free", free).add("total", total).add("oldest", oldest).add("newest", newest);
}

@@ -17,6 +17,7 @@

package org.jclouds.openstack.marconi.v1.domain;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Optional;
import org.jclouds.javax.annotation.Nullable;
@@ -65,8 +66,8 @@ public boolean equals(Object obj) {
return Objects.equal(this.name, that.name);
}

protected Objects.ToStringHelper string() {
return Objects.toStringHelper(this).omitNullValues()
protected MoreObjects.ToStringHelper string() {
return MoreObjects.toStringHelper(this).omitNullValues()
.add("name", name).add("metadata", metadata);
}

@@ -17,6 +17,7 @@

package org.jclouds.openstack.marconi.v1.domain;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

import static com.google.common.base.Preconditions.checkNotNull;
@@ -52,8 +53,8 @@ public boolean equals(Object obj) {
return Objects.equal(this.messages, that.messages);
}

protected Objects.ToStringHelper string() {
return Objects.toStringHelper(this)
protected MoreObjects.ToStringHelper string() {
return MoreObjects.toStringHelper(this)
.add("messagesStats", messages);
}

@@ -24,6 +24,7 @@

import org.jclouds.javax.annotation.Nullable;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

/**
@@ -88,8 +89,8 @@ public boolean equals(Object obj) {
return Objects.equal(this.macAddress, that.macAddress) && Objects.equal(this.ipAddress, that.ipAddress);
}

protected Objects.ToStringHelper string() {
return Objects.toStringHelper(this).add("macAddress", macAddress).add("ipAddress", ipAddress);
protected MoreObjects.ToStringHelper string() {
return MoreObjects.toStringHelper(this).add("macAddress", macAddress).add("ipAddress", ipAddress);
}

@Override
@@ -20,6 +20,7 @@

import org.jclouds.javax.annotation.Nullable;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

/**
@@ -72,8 +73,8 @@ public boolean equals(Object obj) {
return Objects.equal(this.start, that.start) && Objects.equal(this.end, that.end);
}

protected Objects.ToStringHelper string() {
return Objects.toStringHelper(this).add("start", start).add("end", end);
protected MoreObjects.ToStringHelper string() {
return MoreObjects.toStringHelper(this).add("start", start).add("end", end);
}

@Override
@@ -22,6 +22,7 @@

import org.jclouds.javax.annotation.Nullable;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

/**
@@ -90,7 +91,7 @@ public Builder toBuilder() {

@Override
public String toString() {
return Objects.toStringHelper(this)
return MoreObjects.toStringHelper(this)
.add("networkId", networkId)
.add("enableSnat", enableSnat)
.toString();
@@ -22,6 +22,7 @@

import org.jclouds.javax.annotation.Nullable;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

/**
@@ -89,8 +90,8 @@ public boolean equals(Object obj) {
&& Objects.equal(this.optionValue, that.optionValue);
}

protected Objects.ToStringHelper string() {
return Objects.toStringHelper(this).add("id", id).add("optionName", optionName).add("optionValue", optionValue);
protected MoreObjects.ToStringHelper string() {
return MoreObjects.toStringHelper(this).add("id", id).add("optionName", optionName).add("optionValue", optionValue);
}

@Override
@@ -22,6 +22,7 @@

import org.jclouds.javax.annotation.Nullable;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

/**
@@ -153,7 +154,7 @@ public int hashCode() {

@Override
public String toString() {
return Objects.toStringHelper(this)
return MoreObjects.toStringHelper(this)
.add("id", id)
.add("routerId", routerId)
.add("tenantId", tenantId)
@@ -22,8 +22,9 @@

import org.jclouds.javax.annotation.Nullable;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.base.MoreObjects.ToStringHelper;

/**
* A Neutron Subnet Host Route
@@ -73,7 +74,7 @@ public boolean equals(Object obj) {
}

protected ToStringHelper string() {
return Objects.toStringHelper(this)
return MoreObjects.toStringHelper(this)
.add("destinationCidr", destinationCidr).add("nextHop", nextHop);
}

@@ -22,6 +22,7 @@

import org.jclouds.javax.annotation.Nullable;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

/**
@@ -71,8 +72,8 @@ public boolean equals(Object obj) {
return Objects.equal(this.ipAddress, that.ipAddress) && Objects.equal(this.subnetId, that.subnetId);
}

protected Objects.ToStringHelper string() {
return Objects.toStringHelper(this).add("ipAddress", ipAddress).add("subnetId", subnetId);
protected MoreObjects.ToStringHelper string() {
return MoreObjects.toStringHelper(this).add("ipAddress", ipAddress).add("subnetId", subnetId);
}

@Override
@@ -24,6 +24,7 @@

import org.jclouds.javax.annotation.Nullable;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;

@@ -338,7 +339,7 @@ public boolean equals(Object obj) {

@Override
public String toString() {
return Objects.toStringHelper(this)
return MoreObjects.toStringHelper(this)
.add("id", id)
.add("status", status)
.add("subnets", subnets)
@@ -22,6 +22,7 @@

import org.jclouds.javax.annotation.Nullable;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

/**
@@ -89,8 +90,8 @@ public boolean equals(Object obj) {
&& Objects.equal(this.segmentationId, that.segmentationId);
}

protected Objects.ToStringHelper string() {
return Objects.toStringHelper(this).add("networkType", networkType).add("physicalNetwork", physicalNetwork)
protected MoreObjects.ToStringHelper string() {
return MoreObjects.toStringHelper(this).add("networkType", networkType).add("physicalNetwork", physicalNetwork)
.add("segmentationId", segmentationId);
}

@@ -24,6 +24,7 @@

import org.jclouds.javax.annotation.Nullable;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
@@ -427,7 +428,7 @@ public int hashCode() {

@Override
public String toString() {
return Objects.toStringHelper(this)
return MoreObjects.toStringHelper(this)
.add("id", id)
.add("status", status)
.add("vifType", vifType)
@@ -22,6 +22,7 @@

import org.jclouds.javax.annotation.Nullable;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

/**
@@ -161,7 +162,7 @@ public int hashCode() {

@Override
public String toString() {
return Objects.toStringHelper(this)
return MoreObjects.toStringHelper(this)
.add("id", id)
.add("status", status)
.add("name", name)
@@ -22,6 +22,7 @@

import org.jclouds.javax.annotation.Nullable;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

/**
@@ -75,8 +76,8 @@ public boolean equals(Object obj) {
return Objects.equal(this.subnetId, that.subnetId) && Objects.equal(this.portId, that.portId);
}

protected Objects.ToStringHelper string() {
return Objects.toStringHelper(this).add("subnetId", subnetId).add("portId", portId);
protected MoreObjects.ToStringHelper string() {
return MoreObjects.toStringHelper(this).add("subnetId", subnetId).add("portId", portId);
}

@Override

0 comments on commit 041cd8d

Please sign in to comment.