diff --git a/apis/chef/src/test/java/org/jclouds/chef/filters/SignedHeaderAuthTest.java b/apis/chef/src/test/java/org/jclouds/chef/filters/SignedHeaderAuthTest.java index bfba190af6..73888d0dd1 100644 --- a/apis/chef/src/test/java/org/jclouds/chef/filters/SignedHeaderAuthTest.java +++ b/apis/chef/src/test/java/org/jclouds/chef/filters/SignedHeaderAuthTest.java @@ -102,8 +102,8 @@ public class SignedHeaderAuthTest { .put("X-Ops-Authorization-6", "DzWNPylHJqMeGKVYwGQKpg62QDfe5yXh3wZLiQcXow==") .put("X-Ops-Timestamp", TIMESTAMP_ISO8601).build(); - public static String PUBLIC_KEY; - public static String PRIVATE_KEY; + public static final String PUBLIC_KEY; + public static final String PRIVATE_KEY; static { try { @@ -111,7 +111,7 @@ public class SignedHeaderAuthTest { PRIVATE_KEY = Strings2.toStringAndClose(SignedHeaderAuthTest.class.getResourceAsStream("/privkey.txt")); } catch (IOException e) { - Throwables.propagate(e); + throw Throwables.propagate(e); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Network.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Network.java index 94f0f5b9b8..74713227bf 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Network.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Network.java @@ -52,8 +52,8 @@ public class Network { protected String broadcastDomainType; protected URI broadcastURI; protected String displayText; - protected String DNS1; - protected String DNS2; + protected String dns1; + protected String dns2; protected String domain; protected String domainId; protected String endIP; @@ -72,7 +72,7 @@ public class Network { protected String name; protected String state; protected GuestIPType guestIPType; - protected String VLAN; + protected String vlan; protected TrafficType trafficType; protected String zoneId; protected boolean securityGroupEnabled; @@ -123,8 +123,8 @@ public class Network { * @return the DNS for the Network */ public T DNS(List DNS) { - if (!DNS.isEmpty()) this.DNS1 = DNS.get(0); - if (DNS.size() > 1) this.DNS2 = DNS.get(1); + if (!DNS.isEmpty()) this.dns1 = DNS.get(0); + if (DNS.size() > 1) this.dns2 = DNS.get(1); return self(); } @@ -275,8 +275,8 @@ public class Network { /** * @see Network#getVLAN() */ - public T VLAN(String VLAN) { - this.VLAN = VLAN; + public T VLAN(String vlan) { + this.vlan = vlan; return self(); } @@ -325,7 +325,7 @@ public class Network { } public Network build() { - return new Network(id, account, broadcastDomainType, broadcastURI, displayText, DNS1, DNS2, domain, domainId, endIP, gateway, isDefault, isShared, isSystem, netmask, networkDomain, networkOfferingAvailability, networkOfferingDisplayText, networkOfferingId, networkOfferingName, related, startIP, name, state, guestIPType, VLAN, trafficType, zoneId, tags, securityGroupEnabled, services); + return new Network(id, account, broadcastDomainType, broadcastURI, displayText, dns1, dns2, domain, domainId, endIP, gateway, isDefault, isShared, isSystem, netmask, networkDomain, networkOfferingAvailability, networkOfferingDisplayText, networkOfferingId, networkOfferingName, related, startIP, name, state, guestIPType, vlan, trafficType, zoneId, tags, securityGroupEnabled, services); } public T fromNetwork(Network in) { @@ -375,8 +375,8 @@ public class Network { private final String broadcastDomainType; private final URI broadcastURI; private final String displayText; - private final String DNS1; - private final String DNS2; + private final String dns1; + private final String dns2; private final String domain; private final String domainId; private final String endIP; @@ -395,7 +395,7 @@ public class Network { private final String name; private final String state; private final GuestIPType guestIPType; - private final String VLAN; + private final String vlan; private final TrafficType trafficType; private final String zoneId; private final Set tags; @@ -406,20 +406,20 @@ public class Network { "id", "account", "broadcastdomaintype", "broadcasturi", "displaytext", "dns1", "dns2", "domain", "domainid", "endip", "gateway", "isdefault", "isshared", "issystem", "netmask", "networkdomain", "networkofferingavailability", "networkofferingdisplaytext", "networkofferingid", "networkofferingname", "related", "startip", "name", "state", "type", "vlan", "traffictype", "zoneid", "tags", "securitygroupenabled", "service" }) protected Network(String id, @Nullable String account, @Nullable String broadcastDomainType, @Nullable URI broadcastURI, - @Nullable String displayText, @Nullable String DNS1, @Nullable String DNS2, @Nullable String domain, @Nullable String domainId, + @Nullable String displayText, @Nullable String dns1, @Nullable String dns2, @Nullable String domain, @Nullable String domainId, @Nullable String endIP, @Nullable String gateway, boolean isDefault, boolean isShared, boolean isSystem, @Nullable String netmask, @Nullable String networkDomain, @Nullable String networkOfferingAvailability, @Nullable String networkOfferingDisplayText, @Nullable String networkOfferingId, @Nullable String networkOfferingName, @Nullable String related, @Nullable String startIP, @Nullable String name, @Nullable String state, - @Nullable GuestIPType guestIPType, @Nullable String VLAN, @Nullable TrafficType trafficType, + @Nullable GuestIPType guestIPType, @Nullable String vlan, @Nullable TrafficType trafficType, @Nullable String zoneId, @Nullable Set tags, boolean securityGroupEnabled, Set services) { this.id = checkNotNull(id, "id"); this.account = account; this.broadcastDomainType = broadcastDomainType; this.broadcastURI = broadcastURI; this.displayText = displayText; - this.DNS1 = DNS1; - this.DNS2 = DNS2; + this.dns1 = dns1; + this.dns2 = dns2; this.domain = domain; this.domainId = domainId; this.endIP = endIP; @@ -438,7 +438,7 @@ public class Network { this.name = name; this.state = state; this.guestIPType = guestIPType; - this.VLAN = VLAN; + this.vlan = vlan; this.trafficType = trafficType; this.zoneId = zoneId; this.tags = tags != null ? ImmutableSet.copyOf(tags) : ImmutableSet. of(); @@ -487,10 +487,10 @@ public class Network { public List getDNS() { ImmutableList.Builder builder = ImmutableList.builder(); - if (DNS1 != null && !"".equals(DNS1)) - builder.add(DNS1); - if (DNS2 != null && !"".equals(DNS2)) - builder.add(DNS2); + if (dns1 != null && !"".equals(dns1)) + builder.add(dns1); + if (dns2 != null && !"".equals(dns2)) + builder.add(dns2); return builder.build(); } @@ -639,7 +639,7 @@ public class Network { */ @Nullable public String getVLAN() { - return this.VLAN; + return this.vlan; } /** @@ -681,7 +681,7 @@ public class Network { @Override public int hashCode() { - return Objects.hashCode(id, account, broadcastDomainType, broadcastURI, displayText, DNS1, DNS2, domain, domainId, endIP, gateway, isDefault, isShared, isSystem, netmask, networkDomain, networkOfferingAvailability, networkOfferingDisplayText, networkOfferingId, networkOfferingName, related, startIP, name, state, guestIPType, VLAN, trafficType, zoneId, tags, securityGroupEnabled, services); + return Objects.hashCode(id, account, broadcastDomainType, broadcastURI, displayText, dns1, dns2, domain, domainId, endIP, gateway, isDefault, isShared, isSystem, netmask, networkDomain, networkOfferingAvailability, networkOfferingDisplayText, networkOfferingId, networkOfferingName, related, startIP, name, state, guestIPType, vlan, trafficType, zoneId, tags, securityGroupEnabled, services); } @Override @@ -694,8 +694,8 @@ public class Network { && Objects.equal(this.broadcastDomainType, that.broadcastDomainType) && Objects.equal(this.broadcastURI, that.broadcastURI) && Objects.equal(this.displayText, that.displayText) - && Objects.equal(this.DNS1, that.DNS1) - && Objects.equal(this.DNS2, that.DNS2) + && Objects.equal(this.dns1, that.dns1) + && Objects.equal(this.dns2, that.dns2) && Objects.equal(this.domain, that.domain) && Objects.equal(this.domainId, that.domainId) && Objects.equal(this.endIP, that.endIP) @@ -714,7 +714,7 @@ public class Network { && Objects.equal(this.name, that.name) && Objects.equal(this.state, that.state) && Objects.equal(this.guestIPType, that.guestIPType) - && Objects.equal(this.VLAN, that.VLAN) + && Objects.equal(this.vlan, that.vlan) && Objects.equal(this.trafficType, that.trafficType) && Objects.equal(this.zoneId, that.zoneId) && Objects.equal(this.tags, that.tags) @@ -725,12 +725,12 @@ public class Network { protected ToStringHelper string() { return Objects.toStringHelper(this) .add("id", id).add("account", account).add("broadcastDomainType", broadcastDomainType).add("broadcastURI", broadcastURI) - .add("displayText", displayText).add("DNS1", DNS1).add("DNS2", DNS2).add("domain", domain).add("domainId", domainId) + .add("displayText", displayText).add("DNS1", dns1).add("dns2", dns2).add("domain", domain).add("domainId", domainId) .add("endIP", endIP).add("gateway", gateway).add("isDefault", isDefault).add("isShared", isShared).add("isSystem", isSystem) .add("netmask", netmask).add("networkDomain", networkDomain).add("networkOfferingAvailability", networkOfferingAvailability) .add("networkOfferingDisplayText", networkOfferingDisplayText).add("networkOfferingId", networkOfferingId) .add("networkOfferingName", networkOfferingName).add("related", related).add("startIP", startIP).add("name", name) - .add("state", state).add("guestIPType", guestIPType).add("VLAN", VLAN).add("trafficType", trafficType) + .add("state", state).add("guestIPType", guestIPType).add("VLAN", vlan).add("trafficType", trafficType) .add("zoneId", zoneId).add("tags", tags).add("securityGroupEnabled", securityGroupEnabled).add("services", services); } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Zone.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Zone.java index b710710c29..ba99e0ad1a 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Zone.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Zone.java @@ -45,8 +45,8 @@ public class Zone implements Comparable { protected String id; protected String description; protected String displayText; - protected String DNS1; - protected String DNS2; + protected String dns1; + protected String dns2; protected String domain; protected String domainId; protected String guestCIDRAddress; @@ -54,7 +54,7 @@ public class Zone implements Comparable { protected String internalDNS2; protected String name; protected NetworkType networkType; - protected String VLAN; + protected String vlan; protected boolean securityGroupsEnabled; protected AllocationState allocationState; protected String dhcpProvider; @@ -89,8 +89,8 @@ public class Zone implements Comparable { * @see Zone#getDNS() */ public T DNS(List DNS) { - if (!DNS.isEmpty()) this.DNS1 = DNS.get(0); - if (DNS.size() > 1) this.DNS2 = DNS.get(1); + if (!DNS.isEmpty()) this.dns1 = DNS.get(0); + if (DNS.size() > 1) this.dns2 = DNS.get(1); return self(); } @@ -146,8 +146,8 @@ public class Zone implements Comparable { /** * @see Zone#getVLAN() */ - public T VLAN(String VLAN) { - this.VLAN = VLAN; + public T VLAN(String vlan) { + this.vlan = vlan; return self(); } @@ -196,8 +196,8 @@ public class Zone implements Comparable { } public Zone build() { - return new Zone(id, description, displayText, DNS1, DNS2, domain, domainId, guestCIDRAddress, internalDNS1, internalDNS2, - name, networkType, VLAN, securityGroupsEnabled, allocationState, dhcpProvider, zoneToken, tags); + return new Zone(id, description, displayText, dns1, dns2, domain, domainId, guestCIDRAddress, internalDNS1, internalDNS2, + name, networkType, vlan, securityGroupsEnabled, allocationState, dhcpProvider, zoneToken, tags); } public T fromZone(Zone in) { @@ -231,8 +231,8 @@ public class Zone implements Comparable { private final String id; private final String description; private final String displayText; - private final String DNS1; - private final String DNS2; + private final String dns1; + private final String dns2; private final String domain; private final String domainId; private final String guestCIDRAddress; @@ -240,7 +240,7 @@ public class Zone implements Comparable { private final String internalDNS2; private final String name; private final NetworkType networkType; - private final String VLAN; + private final String vlan; private final boolean securityGroupsEnabled; private final AllocationState allocationState; private final String dhcpProvider; @@ -250,16 +250,16 @@ public class Zone implements Comparable { @ConstructorProperties({ "id", "description", "displaytext", "dns1", "dns2", "domain", "domainid", "guestcidraddress", "internaldns1", "internaldns2", "name", "networktype", "vlan", "securitygroupsenabled", "allocationstate", "dhcpprovider", "zonetoken", "tags" }) - protected Zone(String id, @Nullable String description, @Nullable String displayText, @Nullable String DNS1, @Nullable String DNS2, + protected Zone(String id, @Nullable String description, @Nullable String displayText, @Nullable String dns1, @Nullable String dns2, @Nullable String domain, @Nullable String domainId, @Nullable String guestCIDRAddress, @Nullable String internalDNS1, - @Nullable String internalDNS2, @Nullable String name, @Nullable NetworkType networkType, @Nullable String VLAN, + @Nullable String internalDNS2, @Nullable String name, @Nullable NetworkType networkType, @Nullable String vlan, boolean securityGroupsEnabled, @Nullable AllocationState allocationState, @Nullable String dhcpProvider, @Nullable String zoneToken, @Nullable Set tags) { this.id = checkNotNull(id, "id"); this.description = description; this.displayText = displayText; - this.DNS1 = DNS1; - this.DNS2 = DNS2; + this.dns1 = dns1; + this.dns2 = dns2; this.domain = domain; this.domainId = domainId; this.guestCIDRAddress = guestCIDRAddress; @@ -267,7 +267,7 @@ public class Zone implements Comparable { this.internalDNS2 = internalDNS2; this.name = name; this.networkType = networkType; - this.VLAN = VLAN; + this.vlan = vlan; this.securityGroupsEnabled = securityGroupsEnabled; this.allocationState = allocationState; this.dhcpProvider = dhcpProvider; @@ -303,10 +303,10 @@ public class Zone implements Comparable { */ public List getDNS() { ImmutableList.Builder builder = ImmutableList.builder(); - if (DNS1 != null && !"".equals(DNS1)) - builder.add(DNS1); - if (DNS2 != null && !"".equals(DNS2)) - builder.add(DNS2); + if (dns1 != null && !"".equals(dns1)) + builder.add(dns1); + if (dns2 != null && !"".equals(dns2)) + builder.add(dns2); return builder.build(); } @@ -367,7 +367,7 @@ public class Zone implements Comparable { */ @Nullable public String getVLAN() { - return this.VLAN; + return this.vlan; } /** @@ -410,8 +410,8 @@ public class Zone implements Comparable { @Override public int hashCode() { - return Objects.hashCode(id, description, displayText, DNS1, DNS2, domain, domainId, guestCIDRAddress, internalDNS1, - internalDNS2, name, networkType, VLAN, securityGroupsEnabled, allocationState, dhcpProvider, zoneToken, tags); + return Objects.hashCode(id, description, displayText, dns1, dns2, domain, domainId, guestCIDRAddress, internalDNS1, + internalDNS2, name, networkType, vlan, securityGroupsEnabled, allocationState, dhcpProvider, zoneToken, tags); } @Override @@ -422,8 +422,8 @@ public class Zone implements Comparable { return Objects.equal(this.id, that.id) && Objects.equal(this.description, that.description) && Objects.equal(this.displayText, that.displayText) - && Objects.equal(this.DNS1, that.DNS1) - && Objects.equal(this.DNS2, that.DNS2) + && Objects.equal(this.dns1, that.dns1) + && Objects.equal(this.dns2, that.dns2) && Objects.equal(this.domain, that.domain) && Objects.equal(this.domainId, that.domainId) && Objects.equal(this.guestCIDRAddress, that.guestCIDRAddress) @@ -431,7 +431,7 @@ public class Zone implements Comparable { && Objects.equal(this.internalDNS2, that.internalDNS2) && Objects.equal(this.name, that.name) && Objects.equal(this.networkType, that.networkType) - && Objects.equal(this.VLAN, that.VLAN) + && Objects.equal(this.vlan, that.vlan) && Objects.equal(this.securityGroupsEnabled, that.securityGroupsEnabled) && Objects.equal(this.allocationState, that.allocationState) && Objects.equal(this.dhcpProvider, that.dhcpProvider) @@ -441,9 +441,9 @@ public class Zone implements Comparable { protected ToStringHelper string() { return Objects.toStringHelper(this) - .add("id", id).add("description", description).add("displayText", displayText).add("DNS1", DNS1).add("DNS2", DNS2) + .add("id", id).add("description", description).add("displayText", displayText).add("DNS1", dns1).add("DNS2", dns2) .add("domain", domain).add("domainId", domainId).add("guestCIDRAddress", guestCIDRAddress).add("internalDNS1", internalDNS1) - .add("internalDNS2", internalDNS2).add("name", name).add("networkType", networkType).add("VLAN", VLAN) + .add("internalDNS2", internalDNS2).add("name", name).add("networkType", networkType).add("VLAN", vlan) .add("securityGroupsEnabled", securityGroupsEnabled).add("allocationState", allocationState).add("dhcpProvider", dhcpProvider) .add("zoneToken", zoneToken).add("tags", tags); } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/options/ListStoragePoolsOptions.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/options/ListStoragePoolsOptions.java index 4a372cbd8f..6ca915e380 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/options/ListStoragePoolsOptions.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/options/ListStoragePoolsOptions.java @@ -25,7 +25,7 @@ import com.google.common.collect.ImmutableSet; */ public class ListStoragePoolsOptions extends BaseHttpRequestOptions { - public static ListStoragePoolsOptions NONE = new ListStoragePoolsOptions(); + public static final ListStoragePoolsOptions NONE = new ListStoragePoolsOptions(); public static class Builder { diff --git a/apis/elasticstack/src/test/java/org/jclouds/elasticstack/functions/MapToDriveInfoTest.java b/apis/elasticstack/src/test/java/org/jclouds/elasticstack/functions/MapToDriveInfoTest.java index 966c03b453..5e572489ff 100644 --- a/apis/elasticstack/src/test/java/org/jclouds/elasticstack/functions/MapToDriveInfoTest.java +++ b/apis/elasticstack/src/test/java/org/jclouds/elasticstack/functions/MapToDriveInfoTest.java @@ -33,7 +33,7 @@ import com.google.common.collect.ImmutableSet; @Test(groups = { "unit" }) public class MapToDriveInfoTest { - public static DriveInfo ONE = new DriveInfo.Builder() + public static final DriveInfo ONE = new DriveInfo.Builder() .status(DriveStatus.ACTIVE) .name("Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System") .metrics( diff --git a/apis/elasticstack/src/test/java/org/jclouds/elasticstack/functions/MapToServerInfoTest.java b/apis/elasticstack/src/test/java/org/jclouds/elasticstack/functions/MapToServerInfoTest.java index 2427f32c96..6e48a907e4 100644 --- a/apis/elasticstack/src/test/java/org/jclouds/elasticstack/functions/MapToServerInfoTest.java +++ b/apis/elasticstack/src/test/java/org/jclouds/elasticstack/functions/MapToServerInfoTest.java @@ -41,7 +41,7 @@ import com.google.common.collect.ImmutableSet; @Test(groups = { "unit" }) public class MapToServerInfoTest { - public static ServerInfo ONE = new ServerInfo.Builder() + public static final ServerInfo ONE = new ServerInfo.Builder() .persistent(true) .uuid("f8bee9cd-8e4b-4a05-8593-1314e3bfe49b") .cpu(2000) @@ -75,7 +75,7 @@ public class MapToServerInfoTest { .readBytes(45686784).writeRequests(3698).writeBytes(15147008).build())).build()) .build(); - public static ServerInfo TWO = new ServerInfo.Builder() + public static final ServerInfo TWO = new ServerInfo.Builder() .status(ServerStatus.STOPPED) .name("Demo") .mem(1024) @@ -123,7 +123,7 @@ public class MapToServerInfoTest { } - public static ServerInfo NEW = new ServerInfo.Builder() + public static final ServerInfo NEW = new ServerInfo.Builder() .persistent(true) .uuid("bd98615a-6f74-4d63-ad1e-b13338b9356a") .cpu(1000) diff --git a/apis/elasticstack/src/test/java/org/jclouds/elasticstack/functions/MapToStandardDriveTest.java b/apis/elasticstack/src/test/java/org/jclouds/elasticstack/functions/MapToStandardDriveTest.java index 8d22423bce..a4a2903457 100644 --- a/apis/elasticstack/src/test/java/org/jclouds/elasticstack/functions/MapToStandardDriveTest.java +++ b/apis/elasticstack/src/test/java/org/jclouds/elasticstack/functions/MapToStandardDriveTest.java @@ -33,7 +33,7 @@ import com.google.common.collect.ImmutableSet; @Test(groups = { "unit" }) public class MapToStandardDriveTest { - public static StandardDrive ONE = new StandardDrive.Builder() + public static final StandardDrive ONE = new StandardDrive.Builder() .name("Windows Web Server 2008 R2") .uuid("11b84345-7169-4279-8038-18d6ba1a7712")// .claimType(ClaimType.SHARED) diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerExtendedStatus.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerExtendedStatus.java index 31164705dc..944e0577ed 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerExtendedStatus.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/ServerExtendedStatus.java @@ -36,8 +36,6 @@ import com.google.common.base.Objects.ToStringHelper; */ public class ServerExtendedStatus { - public static String PREFIX; - public static Builder builder() { return new ConcreteBuilder(); } diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApiLiveTest.java index 506960f600..f2514b37dd 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApiLiveTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApiLiveTest.java @@ -31,8 +31,8 @@ import com.google.common.collect.FluentIterable; @Test(groups = "live", testName = "KeyPairApiLiveTest") public class KeyPairApiLiveTest extends BaseNovaApiLiveTest { - final String KEYPAIR_NAME = "testkp"; - final String PUBLIC_KEY = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCrrBREFxz3002l1HuXz0+UOdJQ/mOYD5DiJwwB/TOybwIKQJPOxJWA9gBoo4k9dthTKBTaEYbzrll7iZcp59E80S6mNiAr3mUgi+x5Y8uyXeJ2Ws+h6peVyFVUu9epkwpcTd1GVfdcVWsTajwDz9+lxCDhl0RZKDFoT0scTxbj/w== nova@nv-aw2az2-api0002"; + private static final String KEYPAIR_NAME = "testkp"; + private static final String PUBLIC_KEY = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCrrBREFxz3002l1HuXz0+UOdJQ/mOYD5DiJwwB/TOybwIKQJPOxJWA9gBoo4k9dthTKBTaEYbzrll7iZcp59E80S6mNiAr3mUgi+x5Y8uyXeJ2Ws+h6peVyFVUu9epkwpcTd1GVfdcVWsTajwDz9+lxCDhl0RZKDFoT0scTxbj/w== nova@nv-aw2az2-api0002"; public void testListKeyPairs() throws Exception { for (String regionId : api.getConfiguredRegions()) { diff --git a/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStoreParallelLiveTest.java b/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStoreParallelLiveTest.java index 7a99121bab..937100fb8b 100644 --- a/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStoreParallelLiveTest.java +++ b/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStoreParallelLiveTest.java @@ -56,10 +56,10 @@ import com.google.common.util.concurrent.MoreExecutors; @Test(groups = "live", singleThreaded = true) public class RegionScopedSwiftBlobStoreParallelLiveTest extends BaseBlobStoreIntegrationTest { - private final File BIG_FILE; - private final long SIZE = 10 * 1000 * 1000; + private static final File BIG_FILE = new File("random.dat"); + private static final long SIZE = 10 * 1000 * 1000; private BlobStore blobStore; - private String ETAG; + private String etag; private ListeningExecutorService executor = MoreExecutors.listeningDecorator( MoreExecutors.getExitingExecutorService( @@ -67,7 +67,7 @@ public class RegionScopedSwiftBlobStoreParallelLiveTest extends BaseBlobStoreInt 5000L, TimeUnit.MILLISECONDS, new ArrayBlockingQueue(10, true), new ThreadPoolExecutor.CallerRunsPolicy()))); - private String CONTAINER = "jcloudsparalleltest" + UUID.randomUUID(); + private static final String CONTAINER = "jcloudsparalleltest" + UUID.randomUUID(); public RegionScopedSwiftBlobStoreParallelLiveTest() { provider = "openstack-swift"; @@ -96,9 +96,9 @@ public class RegionScopedSwiftBlobStoreParallelLiveTest extends BaseBlobStoreInt blobStore = getBlobStore(); createRandomFile(SIZE, BIG_FILE); HashCode hashCode = Files.hash(BIG_FILE, Hashing.md5()); - ETAG = hashCode.toString(); + etag = hashCode.toString(); blobStore.createContainerInLocation(null, CONTAINER); - System.out.println("generated file md5: " + ETAG); + System.out.println("generated file md5: " + etag); } @AfterClass @@ -119,7 +119,7 @@ public class RegionScopedSwiftBlobStoreParallelLiveTest extends BaseBlobStoreInt .build(); // configure the blobstore to use multipart uploading of the file String eTag = blobStore.putBlob(CONTAINER, blob, multipart(executor)); - // assertEquals(eTag, ETAG); + // assertEquals(eTag, etag); // The etag returned by Swift is not the md5 of the Blob uploaded // It is the md5 of the concatenated segment md5s } @@ -129,7 +129,7 @@ public class RegionScopedSwiftBlobStoreParallelLiveTest extends BaseBlobStoreInt final File downloadedFile = new File(BIG_FILE + ".downloaded"); blobStore.downloadBlob(CONTAINER, BIG_FILE.getName(), downloadedFile, executor); String eTag = Files.hash(downloadedFile, Hashing.md5()).toString(); - assertEquals(eTag, ETAG); + assertEquals(eTag, etag); } @Test(dependsOnMethods = "uploadMultipartBlob", singleThreaded = true) @@ -146,7 +146,7 @@ public class RegionScopedSwiftBlobStoreParallelLiveTest extends BaseBlobStoreInt } is.close(); - assertEquals(hasher.hash().toString(), ETAG); + assertEquals(hasher.hash().toString(), etag); } private void createRandomFile(long size, File file) throws IOException, InterruptedException { diff --git a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/internal/BaseLoadBalancer.java b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/internal/BaseLoadBalancer.java index 1b892e09c7..4cb61545ba 100644 --- a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/internal/BaseLoadBalancer.java +++ b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/domain/internal/BaseLoadBalancer.java @@ -18,6 +18,7 @@ package org.jclouds.rackspace.cloudloadbalancers.v1.domain.internal; import static com.google.common.base.Preconditions.checkNotNull; +import java.util.Collection; import java.util.Map; import java.util.Set; import java.util.SortedSet; @@ -40,8 +41,9 @@ public class BaseLoadBalancer, T extends BaseLoadBalancer< private static final String ENABLED = "enabled"; private static final String PERSISTENCE_TYPE = "persistenceType"; - public static Algorithm[] WEIGHTED_ALGORITHMS = { Algorithm.WEIGHTED_LEAST_CONNECTIONS, - Algorithm.WEIGHTED_ROUND_ROBIN }; + public static final Collection WEIGHTED_ALGORITHMS = ImmutableSet.of( + Algorithm.WEIGHTED_LEAST_CONNECTIONS, + Algorithm.WEIGHTED_ROUND_ROBIN); protected String name; protected String protocol; diff --git a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApiLiveTest.java b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApiLiveTest.java index 8dd8a9b592..67c6f54bd2 100644 --- a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApiLiveTest.java +++ b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApiLiveTest.java @@ -22,7 +22,6 @@ import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; -import java.util.Arrays; import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -114,7 +113,7 @@ public class NodeApiLiveTest extends BaseCloudLoadBalancersApiLiveTest { assert n.getAddress() != null : n; assert n.getPort() != -1 : n; assert n.getStatus() != null : n; - assert !Arrays.asList(LoadBalancer.WEIGHTED_ALGORITHMS).contains(lb.getAlgorithm()) + assert !LoadBalancer.WEIGHTED_ALGORITHMS.contains(lb.getAlgorithm()) || n.getWeight() != null : n; Node getDetails = api.getNodeApi(lb.getRegion(), lb.getId()).get(n.getId()); @@ -125,7 +124,7 @@ public class NodeApiLiveTest extends BaseCloudLoadBalancersApiLiveTest { assertEquals(getDetails.getAddress(), n.getAddress()); assertEquals(getDetails.getPort(), n.getPort()); assertEquals(getDetails.getStatus(), n.getStatus()); - if (Arrays.asList(LoadBalancer.WEIGHTED_ALGORITHMS).contains(lb.getAlgorithm())) { + if (LoadBalancer.WEIGHTED_ALGORITHMS.contains(lb.getAlgorithm())) { assertEquals(getDetails.getWeight(), n.getWeight()); } } catch (AssertionError e) { diff --git a/apis/s3/src/main/java/org/jclouds/s3/functions/ETagFromHttpResponseViaRegex.java b/apis/s3/src/main/java/org/jclouds/s3/functions/ETagFromHttpResponseViaRegex.java index 35ac9cc2de..953dbcd209 100644 --- a/apis/s3/src/main/java/org/jclouds/s3/functions/ETagFromHttpResponseViaRegex.java +++ b/apis/s3/src/main/java/org/jclouds/s3/functions/ETagFromHttpResponseViaRegex.java @@ -29,8 +29,8 @@ import com.google.common.base.Function; @Singleton public class ETagFromHttpResponseViaRegex implements Function { - private static Pattern pattern = Pattern.compile("([\\S&&[^<]]+)"); - private static String ESCAPED_QUOTE = """; + private static final Pattern PATTERN = Pattern.compile("([\\S&&[^<]]+)"); + private static final String ESCAPED_QUOTE = """; private final ReturnStringIf2xx returnStringIf200; @Inject @@ -43,7 +43,7 @@ public class ETagFromHttpResponseViaRegex implements Function FN; + private final Function fn; @Inject public BindMapToHeadersWithPrefix(@Named(PROPERTY_USER_METADATA_PREFIX) final String metadataPrefix) { checkNotNull(metadataPrefix, PROPERTY_USER_METADATA_PREFIX); - FN = new Function() { + fn = new Function() { @Override public String apply(String arg0) { @@ -63,7 +63,7 @@ public class BindMapToHeadersWithPrefix implements Binder { checkArgument(checkNotNull(input, "input") instanceof Map, "this binder is only valid for Maps!"); checkNotNull(request, "request"); - Map userMetadata = Maps2.transformKeys((Map) input, FN); + Map userMetadata = Maps2.transformKeys((Map) input, fn); return (R) request.toBuilder().replaceHeaders(Multimaps.forMap(userMetadata)).build(); } diff --git a/blobstore/src/test/java/org/jclouds/blobstore/strategy/internal/MpuPartitioningAlgorithmTest.java b/blobstore/src/test/java/org/jclouds/blobstore/strategy/internal/MpuPartitioningAlgorithmTest.java index bcf29e9477..423e91a064 100644 --- a/blobstore/src/test/java/org/jclouds/blobstore/strategy/internal/MpuPartitioningAlgorithmTest.java +++ b/blobstore/src/test/java/org/jclouds/blobstore/strategy/internal/MpuPartitioningAlgorithmTest.java @@ -26,9 +26,9 @@ import org.testng.annotations.Test; */ @Test(groups = "unit") public final class MpuPartitioningAlgorithmTest { - private final long MIN_PART_SIZE = 5L * 1024 * 1024; - private final long MAX_PART_SIZE = 5L * 1024 * 1024 * 1024; - private final int MAX_NUMBER_OF_PARTS = 10 * 1000; + private static final long MIN_PART_SIZE = 5L * 1024 * 1024; + private static final long MAX_PART_SIZE = 5L * 1024 * 1024 * 1024; + private static final int MAX_NUMBER_OF_PARTS = 10 * 1000; /** * Below 1 parts the MPU is not used. diff --git a/core/src/test/java/org/jclouds/reflect/Reflection2Test.java b/core/src/test/java/org/jclouds/reflect/Reflection2Test.java index a51e0da149..f61a3ed387 100644 --- a/core/src/test/java/org/jclouds/reflect/Reflection2Test.java +++ b/core/src/test/java/org/jclouds/reflect/Reflection2Test.java @@ -108,7 +108,7 @@ public class Reflection2Test { assertEquals(methodInSuper.getParameters().get(0).getType().getRawType(), Object.class); } - ImmutableSet SET_METHODS = ImmutableSet.of( + private static final ImmutableSet SET_METHODS = ImmutableSet.of( // Java 6 and 7 methods "add", "addAll", @@ -131,7 +131,7 @@ public class Reflection2Test { "spliterator", "stream"); - ImmutableSet SORTED_SET_METHODS = ImmutableSet.builder() + private static final ImmutableSet SORTED_SET_METHODS = ImmutableSet.builder() .addAll(SET_METHODS) .add("comparator") .add("first") diff --git a/core/src/test/java/org/jclouds/util/Predicates2Test.java b/core/src/test/java/org/jclouds/util/Predicates2Test.java index 66e610de73..85a08289e5 100644 --- a/core/src/test/java/org/jclouds/util/Predicates2Test.java +++ b/core/src/test/java/org/jclouds/util/Predicates2Test.java @@ -40,10 +40,10 @@ import com.google.common.collect.Lists; @Test(groups = "unit", singleThreaded = true) public class Predicates2Test { // Grace must be reasonably big; Thread.sleep can take a bit longer to wake up sometimes... - public static int SLOW_BUILD_SERVER_GRACE = 250; + public static final int SLOW_BUILD_SERVER_GRACE = 250; // Sometimes returns sooner than timer would predict (e.g. observed 2999ms, when expected 3000ms) - public static int EARLY_RETURN_GRACE = 10; + public static final int EARLY_RETURN_GRACE = 10; private Stopwatch stopwatch; diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/ForwardingRuleCreationBinderTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/ForwardingRuleCreationBinderTest.java index 5190129979..1686427525 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/ForwardingRuleCreationBinderTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/ForwardingRuleCreationBinderTest.java @@ -35,10 +35,10 @@ import com.google.gson.Gson; @Test(groups = "unit", testName = "ForwardingRuleCreationBinderTest") public class ForwardingRuleCreationBinderTest extends BaseGoogleComputeEngineExpectTest{ - private static String DESCRIPTION = "This is a test!"; - private static String IP_ADDRESS = "1.2.1.1.1"; - private static String PORT_RANGE = "1.2.3.4.1"; - private static URI TARGET = URI.create(BASE_URL + "/party/regions/europe-west1/targetPools/test-target-pool"); + private static final String DESCRIPTION = "This is a test!"; + private static final String IP_ADDRESS = "1.2.1.1.1"; + private static final String PORT_RANGE = "1.2.3.4.1"; + private static final URI TARGET = URI.create(BASE_URL + "/party/regions/europe-west1/targetPools/test-target-pool"); Json json = new GsonWrapper(new Gson()); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/HttpHealthCheckCreationBinderTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/HttpHealthCheckCreationBinderTest.java index fa4466f5d7..365ae22bf4 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/HttpHealthCheckCreationBinderTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/HttpHealthCheckCreationBinderTest.java @@ -33,11 +33,11 @@ import com.google.gson.Gson; @Test(groups = "unit", testName = "HttpHealthCheckCreationBinderTest") public class HttpHealthCheckCreationBinderTest extends BaseGoogleComputeEngineExpectTest{ - private String NAME = "testHttpHealthCheck"; - private Integer TIMEOUTSEC = 3; - private Integer UNHEALTHYTHRESHOLD = 5; - private Integer HEALTHYTHRESHOLD = 4; - private static String DESCRIPTION = "This is a test!"; + private static final String NAME = "testHttpHealthCheck"; + private static final int TIMEOUTSEC = 3; + private static final int UNHEALTHYTHRESHOLD = 5; + private static final int HEALTHYTHRESHOLD = 4; + private static final String DESCRIPTION = "This is a test!"; Json json = new GsonWrapper(new Gson()); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetInstanceApiMockTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetInstanceApiMockTest.java index 2bca642f20..f0542287e4 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetInstanceApiMockTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetInstanceApiMockTest.java @@ -32,7 +32,7 @@ import org.testng.annotations.Test; @Test(groups = "unit", testName = "TargetInstanceApiMockTest", singleThreaded = true) public class TargetInstanceApiMockTest extends BaseGoogleComputeEngineApiMockTest { - public static String TARGET_INSTANCE_NAME = "target-instance-1"; + public static final String TARGET_INSTANCE_NAME = "target-instance-1"; public void get() throws Exception { server.enqueue(jsonResponse("/target_instance_get.json")); diff --git a/providers/profitbricks/src/main/java/org/jclouds/profitbricks/http/filters/ProfitBricksSoapMessageEnvelope.java b/providers/profitbricks/src/main/java/org/jclouds/profitbricks/http/filters/ProfitBricksSoapMessageEnvelope.java index af78403d63..1ce83c5340 100644 --- a/providers/profitbricks/src/main/java/org/jclouds/profitbricks/http/filters/ProfitBricksSoapMessageEnvelope.java +++ b/providers/profitbricks/src/main/java/org/jclouds/profitbricks/http/filters/ProfitBricksSoapMessageEnvelope.java @@ -31,12 +31,12 @@ import org.jclouds.io.Payloads; */ public class ProfitBricksSoapMessageEnvelope implements HttpRequestFilter { - private final String SOAP_PREFIX + private static final String SOAP_PREFIX = "" + "" + ""; - private final String SOAP_SUFFIX = ""; + private static final String SOAP_SUFFIX = ""; @Override public HttpRequest filter(HttpRequest request) throws HttpException { diff --git a/providers/profitbricks/src/test/java/org/jclouds/profitbricks/http/ResponseStatusFromPayloadHttpCommandExecutorServiceTest.java b/providers/profitbricks/src/test/java/org/jclouds/profitbricks/http/ResponseStatusFromPayloadHttpCommandExecutorServiceTest.java index 1913ababc5..166cbb904c 100644 --- a/providers/profitbricks/src/test/java/org/jclouds/profitbricks/http/ResponseStatusFromPayloadHttpCommandExecutorServiceTest.java +++ b/providers/profitbricks/src/test/java/org/jclouds/profitbricks/http/ResponseStatusFromPayloadHttpCommandExecutorServiceTest.java @@ -42,7 +42,7 @@ import com.squareup.okhttp.mockwebserver.MockWebServer; @Test(groups = "unit", testName = "ResponseStatusFromPayloadHttpCommandExecutorServiceTest") public class ResponseStatusFromPayloadHttpCommandExecutorServiceTest extends BaseProfitBricksMockTest { - private final int MAX_RETRIES = 5; + private static final int MAX_RETRIES = 5; @Test public void testNotFound() throws Exception { diff --git a/providers/profitbricks/src/test/java/org/jclouds/profitbricks/http/filters/ProfitBricksSoapMessageEnvelopeTest.java b/providers/profitbricks/src/test/java/org/jclouds/profitbricks/http/filters/ProfitBricksSoapMessageEnvelopeTest.java index f6892b7a69..3961a97f5d 100644 --- a/providers/profitbricks/src/test/java/org/jclouds/profitbricks/http/filters/ProfitBricksSoapMessageEnvelopeTest.java +++ b/providers/profitbricks/src/test/java/org/jclouds/profitbricks/http/filters/ProfitBricksSoapMessageEnvelopeTest.java @@ -27,19 +27,19 @@ import org.testng.annotations.Test; @Test(groups = "unit", testName = "ProfitBricksSoapMessageEnvelopeTest") public class ProfitBricksSoapMessageEnvelopeTest { - private final String SOAP_PREFIX + private static final String SOAP_PREFIX = "" + "" + ""; - private final String SOAP_SUFFIX = ""; - private final String endpoint = "https://api.profitbricks.com/1.3"; + private static final String SOAP_SUFFIX = ""; + private static final String ENDPOINT = "https://api.profitbricks.com/1.3"; @Test public void testPayloadEnclosedWithSoapTags() { String requestBody = ""; String expectedPayload = SOAP_PREFIX.concat(requestBody).concat(SOAP_SUFFIX); - HttpRequest request = HttpRequest.builder().method("POST").endpoint(endpoint).payload(requestBody).build(); + HttpRequest request = HttpRequest.builder().method("POST").endpoint(ENDPOINT).payload(requestBody).build(); ProfitBricksSoapMessageEnvelope soapEnvelope = new ProfitBricksSoapMessageEnvelope(); HttpRequest filtered = soapEnvelope.filter(request); @@ -50,7 +50,7 @@ public class ProfitBricksSoapMessageEnvelopeTest { @Test(expectedExceptions = NullPointerException.class, expectedExceptionsMessageRegExp = ".*must contain payload message.*") public void testNullRequest() { - HttpRequest request = HttpRequest.builder().method("POST").endpoint(endpoint).build(); + HttpRequest request = HttpRequest.builder().method("POST").endpoint(ENDPOINT).build(); new ProfitBricksSoapMessageEnvelope().filter(request); } diff --git a/providers/ultradns-ws/src/test/java/org/jclouds/ultradns/ws/binders/ZoneAndResourceRecordToXMLTest.java b/providers/ultradns-ws/src/test/java/org/jclouds/ultradns/ws/binders/ZoneAndResourceRecordToXMLTest.java index 452ec3ec2a..7c89fa735f 100644 --- a/providers/ultradns-ws/src/test/java/org/jclouds/ultradns/ws/binders/ZoneAndResourceRecordToXMLTest.java +++ b/providers/ultradns-ws/src/test/java/org/jclouds/ultradns/ws/binders/ZoneAndResourceRecordToXMLTest.java @@ -24,7 +24,7 @@ import org.testng.annotations.Test; @Test(groups = "unit", testName = "ZoneAndResourceRecordToXMLTest") public class ZoneAndResourceRecordToXMLTest { - String A = ""; + private static final String A = ""; public void testA() { assertEquals(ZoneAndResourceRecordToXML.toXML("jclouds.org.", ResourceRecord.rrBuilder() @@ -34,7 +34,7 @@ public class ZoneAndResourceRecordToXMLTest { .rdata("1.1.1.1").build()), A); } - String MX = ""; + private static final String MX = ""; public void testMX() { assertEquals(ZoneAndResourceRecordToXML.toXML("jclouds.org.", ResourceRecord.rrBuilder() @@ -45,7 +45,7 @@ public class ZoneAndResourceRecordToXMLTest { .infoValue("maileast.jclouds.org.").build()), MX); } - String A_UPDATE = ""; + private static final String A_UPDATE = ""; public void testUpdate() { assertEquals(ZoneAndResourceRecordToXML.update("ABCDEF", A), A_UPDATE);