Prefer valueOf over explicit object creation

This allows use of cached values.  Patched with:

find -name \*.java | xargs sed -i 's/new Boolean(false)/Boolean.FALSE/g'
find -name \*.java | xargs sed -i 's/new Boolean(true)/Boolean.TRUE/g'
find -name \*.java | xargs sed -i 's/new Boolean(/Boolean.valueOf(/g'
find -name \*.java | xargs sed -i 's/new Integer(/Integer.valueOf(/g'
find -name \*.java | xargs sed -i 's/new Long(/Long.valueOf(/g'
This commit is contained in:
Andrew Gaul 2012-07-22 18:05:03 -07:00 committed by Andrew Gaul
parent b517bc79c7
commit 985cccff9a
105 changed files with 218 additions and 218 deletions

View File

@ -72,7 +72,7 @@ public class ListOptions extends BaseHttpRequestOptions {
public Integer getLimit() { public Integer getLimit() {
String maxresults = getFirstHeaderOrNull("x-emc-limit"); String maxresults = getFirstHeaderOrNull("x-emc-limit");
return (maxresults != null) ? new Integer(maxresults) : null; return (maxresults != null) ? Integer.valueOf(maxresults) : null;
} }
public static class Builder { public static class Builder {

View File

@ -251,7 +251,7 @@ public class AtmosClientLiveTest extends BaseBlobStoreIntegrationTest {
} }
private static void verifyMetadata(String metadataValue, AtmosObject getBlob) { private static void verifyMetadata(String metadataValue, AtmosObject getBlob) {
assertEquals(getBlob.getContentMetadata().getContentLength(), new Long(16)); assertEquals(getBlob.getContentMetadata().getContentLength(), Long.valueOf(16));
assert getBlob.getContentMetadata().getContentType().startsWith("text/plain"); assert getBlob.getContentMetadata().getContentType().startsWith("text/plain");
assertEquals(getBlob.getUserMetadata().getMetadata().get("Metadata"), metadataValue); assertEquals(getBlob.getUserMetadata().getMetadata().get("Metadata"), metadataValue);
SystemMetadata md = getBlob.getSystemMetadata(); SystemMetadata md = getBlob.getSystemMetadata();

View File

@ -136,7 +136,7 @@ public class LoadBalancerClientLiveTest extends BaseCloudLoadBalancersClientLive
assertEquals(lb.getRegion(), region); assertEquals(lb.getRegion(), region);
assertEquals(lb.getName(), name); assertEquals(lb.getName(), name);
assertEquals(lb.getProtocol(), "HTTP"); assertEquals(lb.getProtocol(), "HTTP");
assertEquals(lb.getPort(), new Integer(80)); assertEquals(lb.getPort(), Integer.valueOf(80));
assertEquals(Iterables.get(lb.getVirtualIPs(), 0).getType(), Type.PUBLIC); assertEquals(Iterables.get(lb.getVirtualIPs(), 0).getType(), Type.PUBLIC);
} }

View File

@ -344,8 +344,8 @@ public class CloudServersClientLiveTest extends BaseComputeServiceContextLiveTes
assertNotNull(server.getHostId()); assertNotNull(server.getHostId());
assertEquals(server.getStatus(), ServerStatus.ACTIVE); assertEquals(server.getStatus(), ServerStatus.ACTIVE);
assert server.getProgress() >= 0 : "newDetails.getProgress()" + server.getProgress(); assert server.getProgress() >= 0 : "newDetails.getProgress()" + server.getProgress();
assertEquals(new Integer(14362), server.getImageId()); assertEquals(Integer.valueOf(14362), server.getImageId());
assertEquals(new Integer(1), server.getFlavorId()); assertEquals(Integer.valueOf(1), server.getFlavorId());
assertNotNull(server.getAddresses()); assertNotNull(server.getAddresses());
// listAddresses tests.. // listAddresses tests..
assertEquals(client.getAddresses(serverId), server.getAddresses()); assertEquals(client.getAddresses(serverId), server.getAddresses());
@ -445,7 +445,7 @@ public class CloudServersClientLiveTest extends BaseComputeServiceContextLiveTes
blockUntilServerActive(serverId2); blockUntilServerActive(serverId2);
assertIpConfigured(server, adminPass2); assertIpConfigured(server, adminPass2);
assert server.getAddresses().getPublicAddresses().contains(ip) : server.getAddresses() + " doesn't contain " + ip; assert server.getAddresses().getPublicAddresses().contains(ip) : server.getAddresses() + " doesn't contain " + ip;
assertEquals(server.getSharedIpGroupId(), new Integer(sharedIpGroupId)); assertEquals(server.getSharedIpGroupId(), Integer.valueOf(sharedIpGroupId));
} }
private void assertIpConfigured(Server server, String password) { private void assertIpConfigured(Server server, String password) {
@ -518,7 +518,7 @@ public class CloudServersClientLiveTest extends BaseComputeServiceContextLiveTes
public void testCreateImage() throws Exception { public void testCreateImage() throws Exception {
Image image = client.createImageFromServer("hoofie", serverId); Image image = client.createImageFromServer("hoofie", serverId);
assertEquals("hoofie", image.getName()); assertEquals("hoofie", image.getName());
assertEquals(new Integer(serverId), image.getServerId()); assertEquals(Integer.valueOf(serverId), image.getServerId());
imageId = image.getId(); imageId = image.getId();
blockUntilImageActive(imageId); blockUntilImageActive(imageId);
} }
@ -528,7 +528,7 @@ public class CloudServersClientLiveTest extends BaseComputeServiceContextLiveTes
client.rebuildServer(serverId, new RebuildServerOptions().withImage(imageId)); client.rebuildServer(serverId, new RebuildServerOptions().withImage(imageId));
blockUntilServerActive(serverId); blockUntilServerActive(serverId);
// issue Web Hosting #119580 imageId comes back incorrect after rebuild // issue Web Hosting #119580 imageId comes back incorrect after rebuild
assert !new Integer(imageId).equals(client.getServer(serverId).getImageId()); assert !Integer.valueOf(imageId).equals(client.getServer(serverId).getImageId());
} }
@Test(timeOut = 10 * 60 * 1000, dependsOnMethods = "testRebuildServer") @Test(timeOut = 10 * 60 * 1000, dependsOnMethods = "testRebuildServer")
@ -549,7 +549,7 @@ public class CloudServersClientLiveTest extends BaseComputeServiceContextLiveTes
blockUntilServerVerifyResize(serverId); blockUntilServerVerifyResize(serverId);
client.revertResizeServer(serverId); client.revertResizeServer(serverId);
blockUntilServerActive(serverId); blockUntilServerActive(serverId);
assertEquals(new Integer(1), client.getServer(serverId).getFlavorId()); assertEquals(Integer.valueOf(1), client.getServer(serverId).getFlavorId());
} }
@Test(timeOut = 10 * 60 * 1000, dependsOnMethods = "testRebootSoft") @Test(timeOut = 10 * 60 * 1000, dependsOnMethods = "testRebootSoft")
@ -558,7 +558,7 @@ public class CloudServersClientLiveTest extends BaseComputeServiceContextLiveTes
blockUntilServerVerifyResize(serverId2); blockUntilServerVerifyResize(serverId2);
client.confirmResizeServer(serverId2); client.confirmResizeServer(serverId2);
blockUntilServerActive(serverId2); blockUntilServerActive(serverId2);
assertEquals(new Integer(2), client.getServer(serverId2).getFlavorId()); assertEquals(Integer.valueOf(2), client.getServer(serverId2).getFlavorId());
} }
@Test(timeOut = 10 * 60 * 1000, dependsOnMethods = { "testRebootSoft", "testRevertResize", "testConfirmResize" }) @Test(timeOut = 10 * 60 * 1000, dependsOnMethods = { "testRebootSoft", "testRevertResize", "testConfirmResize" })

View File

@ -67,13 +67,13 @@ public class ParseFlavorListFromJsonResponseTest {
List<Flavor> response = parser.apply(HttpResponse.builder().statusCode(200).message("ok").payload(is).build()); List<Flavor> response = parser.apply(HttpResponse.builder().statusCode(200).message("ok").payload(is).build());
assertEquals(response.get(0).getId(), 1); assertEquals(response.get(0).getId(), 1);
assertEquals(response.get(0).getName(), "256 MB Server"); assertEquals(response.get(0).getName(), "256 MB Server");
assertEquals(response.get(0).getDisk(), new Integer(10)); assertEquals(response.get(0).getDisk(), Integer.valueOf(10));
assertEquals(response.get(0).getRam(), new Integer(256)); assertEquals(response.get(0).getRam(), Integer.valueOf(256));
assertEquals(response.get(1).getId(), 2); assertEquals(response.get(1).getId(), 2);
assertEquals(response.get(1).getName(), "512 MB Server"); assertEquals(response.get(1).getName(), "512 MB Server");
assertEquals(response.get(1).getDisk(), new Integer(20)); assertEquals(response.get(1).getDisk(), Integer.valueOf(20));
assertEquals(response.get(1).getRam(), new Integer(512)); assertEquals(response.get(1).getRam(), Integer.valueOf(512));
} }

View File

@ -63,8 +63,8 @@ public class ParseImageFromJsonResponseTest {
assertEquals(response.getId(), 2); assertEquals(response.getId(), 2);
assertEquals(response.getName(), "CentOS 5.2"); assertEquals(response.getName(), "CentOS 5.2");
assertEquals(response.getCreated(), dateService.iso8601SecondsDateParse("2010-08-10T12:00:00Z")); assertEquals(response.getCreated(), dateService.iso8601SecondsDateParse("2010-08-10T12:00:00Z"));
assertEquals(response.getProgress(), new Integer(80)); assertEquals(response.getProgress(), Integer.valueOf(80));
assertEquals(response.getServerId(), new Integer(12)); assertEquals(response.getServerId(), Integer.valueOf(12));
assertEquals(response.getStatus(), ImageStatus.SAVING); assertEquals(response.getStatus(), ImageStatus.SAVING);
assertEquals(response.getUpdated(), dateService.iso8601SecondsDateParse(("2010-10-10T12:00:00Z"))); assertEquals(response.getUpdated(), dateService.iso8601SecondsDateParse(("2010-10-10T12:00:00Z")));

View File

@ -91,8 +91,8 @@ public class ParseImageListFromJsonResponseTest {
assertEquals(response.get(1).getName(), "My Server Backup"); assertEquals(response.get(1).getName(), "My Server Backup");
assertEquals(response.get(1).getCreated(), dateService.iso8601SecondsDateParse("2009-07-07T09:56:16-05:00")); assertEquals(response.get(1).getCreated(), dateService.iso8601SecondsDateParse("2009-07-07T09:56:16-05:00"));
; ;
assertEquals(response.get(1).getProgress(), new Integer(80)); assertEquals(response.get(1).getProgress(), Integer.valueOf(80));
assertEquals(response.get(1).getServerId(), new Integer(12)); assertEquals(response.get(1).getServerId(), Integer.valueOf(12));
assertEquals(response.get(1).getStatus(), ImageStatus.SAVING); assertEquals(response.get(1).getStatus(), ImageStatus.SAVING);
assertEquals(response.get(1).getUpdated(), dateService.iso8601SecondsDateParse("2010-10-10T12:00:00Z")); assertEquals(response.get(1).getUpdated(), dateService.iso8601SecondsDateParse("2010-10-10T12:00:00Z"));
} }

View File

@ -52,11 +52,11 @@ public class ParseServerFromJsonResponseTest {
assertEquals(response.getId(), 1234); assertEquals(response.getId(), 1234);
assertEquals(response.getName(), "sample-server"); assertEquals(response.getName(), "sample-server");
assertEquals(response.getImageId(), new Integer(2)); assertEquals(response.getImageId(), Integer.valueOf(2));
assertEquals(response.getFlavorId(), new Integer(1)); assertEquals(response.getFlavorId(), Integer.valueOf(1));
assertEquals(response.getHostId(), "e4d909c290d0fb1ca068ffaddf22cbd0"); assertEquals(response.getHostId(), "e4d909c290d0fb1ca068ffaddf22cbd0");
assertEquals(response.getStatus(), ServerStatus.BUILD); assertEquals(response.getStatus(), ServerStatus.BUILD);
assertEquals(response.getProgress(), new Integer(60)); assertEquals(response.getProgress(), Integer.valueOf(60));
List<String> publicAddresses = Lists.newArrayList("67.23.10.132", "67.23.10.131"); List<String> publicAddresses = Lists.newArrayList("67.23.10.132", "67.23.10.131");
List<String> privateAddresses = Lists.newArrayList("10.176.42.16"); List<String> privateAddresses = Lists.newArrayList("10.176.42.16");
Addresses addresses1 = new Addresses(); Addresses addresses1 = new Addresses();

View File

@ -73,11 +73,11 @@ public class ParseServerListFromJsonResponseTest {
assertEquals(response.get(0).getId(), 1234); assertEquals(response.get(0).getId(), 1234);
assertEquals(response.get(0).getName(), "sample-server"); assertEquals(response.get(0).getName(), "sample-server");
assertEquals(response.get(0).getImageId(), new Integer(2)); assertEquals(response.get(0).getImageId(), Integer.valueOf(2));
assertEquals(response.get(0).getFlavorId(), new Integer(1)); assertEquals(response.get(0).getFlavorId(), Integer.valueOf(1));
assertEquals(response.get(0).getHostId(), "e4d909c290d0fb1ca068ffaddf22cbd0"); assertEquals(response.get(0).getHostId(), "e4d909c290d0fb1ca068ffaddf22cbd0");
assertEquals(response.get(0).getStatus(), ServerStatus.BUILD); assertEquals(response.get(0).getStatus(), ServerStatus.BUILD);
assertEquals(response.get(0).getProgress(), new Integer(60)); assertEquals(response.get(0).getProgress(), Integer.valueOf(60));
List<String> publicAddresses = Lists.newArrayList("67.23.10.132", "67.23.10.131"); List<String> publicAddresses = Lists.newArrayList("67.23.10.132", "67.23.10.131");
List<String> privateAddresses = Lists.newArrayList("10.176.42.16"); List<String> privateAddresses = Lists.newArrayList("10.176.42.16");
Addresses addresses1 = new Addresses(); Addresses addresses1 = new Addresses();
@ -87,8 +87,8 @@ public class ParseServerListFromJsonResponseTest {
assertEquals(response.get(0).getMetadata(), ImmutableMap.of("Server Label", "Web Head 1", "Image Version", "2.1")); assertEquals(response.get(0).getMetadata(), ImmutableMap.of("Server Label", "Web Head 1", "Image Version", "2.1"));
assertEquals(response.get(1).getId(), 5678); assertEquals(response.get(1).getId(), 5678);
assertEquals(response.get(1).getName(), "sample-server2"); assertEquals(response.get(1).getName(), "sample-server2");
assertEquals(response.get(1).getImageId(), new Integer(2)); assertEquals(response.get(1).getImageId(), Integer.valueOf(2));
assertEquals(response.get(1).getFlavorId(), new Integer(1)); assertEquals(response.get(1).getFlavorId(), Integer.valueOf(1));
assertEquals(response.get(1).getHostId(), "9e107d9d372bb6826bd81d3542a419d6"); assertEquals(response.get(1).getHostId(), "9e107d9d372bb6826bd81d3542a419d6");
assertEquals(response.get(1).getStatus(), ServerStatus.ACTIVE); assertEquals(response.get(1).getStatus(), ServerStatus.ACTIVE);
assertEquals(response.get(1).getProgress(), null); assertEquals(response.get(1).getProgress(), null);

View File

@ -69,7 +69,7 @@ public class MapToDriveInfo implements Function<Map<String, String>, DriveInfo>
if (from.containsKey("readers")) if (from.containsKey("readers"))
builder.readers(Splitter.on(' ').split(from.get("readers"))); builder.readers(Splitter.on(' ').split(from.get("readers")));
if (from.containsKey("size")) if (from.containsKey("size"))
builder.size(new Long(from.get("size"))); builder.size(Long.valueOf(from.get("size")));
Map<String, String> metadata = Maps.newLinkedHashMap(); Map<String, String> metadata = Maps.newLinkedHashMap();
for (Entry<String, String> entry : from.entrySet()) { for (Entry<String, String> entry : from.entrySet()) {
if (entry.getKey().startsWith("user:")) if (entry.getKey().startsWith("user:"))
@ -78,7 +78,7 @@ public class MapToDriveInfo implements Function<Map<String, String>, DriveInfo>
if (from.containsKey("use")) if (from.containsKey("use"))
builder.use(Splitter.on(' ').split(from.get("use"))); builder.use(Splitter.on(' ').split(from.get("use")));
if (from.containsKey("bits")) if (from.containsKey("bits"))
builder.bits(new Integer(from.get("bits"))); builder.bits(Integer.valueOf(from.get("bits")));
if (from.containsKey("url")) if (from.containsKey("url"))
builder.url(URI.create(from.get("url"))); builder.url(URI.create(from.get("url")));
builder.encryptionKey(from.get("encryption:key")); builder.encryptionKey(from.get("encryption:key"));
@ -88,9 +88,9 @@ public class MapToDriveInfo implements Function<Map<String, String>, DriveInfo>
if (from.containsKey("drive_type")) if (from.containsKey("drive_type"))
builder.driveType(Splitter.on(',').split(from.get("drive_type"))); builder.driveType(Splitter.on(',').split(from.get("drive_type")));
if (from.containsKey("autoexpanding")) if (from.containsKey("autoexpanding"))
builder.autoexpanding(new Boolean(from.get("autoexpanding"))); builder.autoexpanding(Boolean.valueOf(from.get("autoexpanding")));
if (from.containsKey("free")) if (from.containsKey("free"))
builder.free(new Boolean(from.get("free"))); builder.free(Boolean.valueOf(from.get("free")));
if (from.containsKey("type")) if (from.containsKey("type"))
builder.type(DriveType.fromValue(from.get("type"))); builder.type(DriveType.fromValue(from.get("type")));
try { try {
@ -104,13 +104,13 @@ public class MapToDriveInfo implements Function<Map<String, String>, DriveInfo>
protected DriveMetrics buildMetrics(Map<String, String> from) { protected DriveMetrics buildMetrics(Map<String, String> from) {
DriveMetrics.Builder metricsBuilder = new DriveMetrics.Builder(); DriveMetrics.Builder metricsBuilder = new DriveMetrics.Builder();
if (from.containsKey("read:bytes")) if (from.containsKey("read:bytes"))
metricsBuilder.readBytes(new Long(from.get("read:bytes"))); metricsBuilder.readBytes(Long.valueOf(from.get("read:bytes")));
if (from.containsKey("read:requests")) if (from.containsKey("read:requests"))
metricsBuilder.readRequests(new Long(from.get("read:requests"))); metricsBuilder.readRequests(Long.valueOf(from.get("read:requests")));
if (from.containsKey("write:bytes")) if (from.containsKey("write:bytes"))
metricsBuilder.writeBytes(new Long(from.get("write:bytes"))); metricsBuilder.writeBytes(Long.valueOf(from.get("write:bytes")));
if (from.containsKey("write:requests")) if (from.containsKey("write:requests"))
metricsBuilder.writeRequests(new Long(from.get("write:requests"))); metricsBuilder.writeRequests(Long.valueOf(from.get("write:requests")));
return metricsBuilder.build(); return metricsBuilder.build();
} }
} }

View File

@ -74,13 +74,13 @@ public class MapToDriveMetrics implements Function<Map<String, String>, Map<Stri
protected DriveMetrics buildMetrics(String key, Map<String, String> from) { protected DriveMetrics buildMetrics(String key, Map<String, String> from) {
DriveMetrics.Builder builder = new DriveMetrics.Builder(); DriveMetrics.Builder builder = new DriveMetrics.Builder();
if (from.containsKey(key + ":read:bytes")) if (from.containsKey(key + ":read:bytes"))
builder.readBytes(new Long(from.get(key + ":read:bytes"))); builder.readBytes(Long.valueOf(from.get(key + ":read:bytes")));
if (from.containsKey(key + ":read:requests")) if (from.containsKey(key + ":read:requests"))
builder.readRequests(new Long(from.get(key + ":read:requests"))); builder.readRequests(Long.valueOf(from.get(key + ":read:requests")));
if (from.containsKey(key + ":write:bytes")) if (from.containsKey(key + ":write:bytes"))
builder.writeBytes(new Long(from.get(key + ":write:bytes"))); builder.writeBytes(Long.valueOf(from.get(key + ":write:bytes")));
if (from.containsKey(key + ":write:requests")) if (from.containsKey(key + ":write:requests"))
builder.writeRequests(new Long(from.get(key + ":write:requests"))); builder.writeRequests(Long.valueOf(from.get(key + ":write:requests")));
return builder.build(); return builder.build();
} }
} }

View File

@ -68,12 +68,12 @@ public class MapToServerInfo implements Function<Map<String, String>, ServerInfo
if (from.containsKey("status")) if (from.containsKey("status"))
builder.status(ServerStatus.fromValue(from.get("status"))); builder.status(ServerStatus.fromValue(from.get("status")));
if (from.containsKey("smp") && !"auto".equals(from.get("smp"))) if (from.containsKey("smp") && !"auto".equals(from.get("smp")))
builder.smp(new Integer(from.get("smp"))); builder.smp(Integer.valueOf(from.get("smp")));
builder.cpu(Integer.parseInt(from.get("cpu"))); builder.cpu(Integer.parseInt(from.get("cpu")));
builder.mem(Integer.parseInt(from.get("mem"))); builder.mem(Integer.parseInt(from.get("mem")));
builder.user(from.get("user")); builder.user(from.get("user"));
if (from.containsKey("started")) if (from.containsKey("started"))
builder.started(new Date(new Long(from.get("started")))); builder.started(new Date(Long.valueOf(from.get("started"))));
builder.uuid(from.get("server")); builder.uuid(from.get("server"));
builder.vnc(new VNC(from.get("vnc:ip"), from.get("vnc:password"), from.containsKey("vnc:tls") builder.vnc(new VNC(from.get("vnc:ip"), from.get("vnc:password"), from.containsKey("vnc:tls")
&& Boolean.valueOf(from.get("vnc:tls")))); && Boolean.valueOf(from.get("vnc:tls"))));

View File

@ -44,13 +44,13 @@ public class MapToServerMetrics implements Function<Map<String, String>, ServerM
public ServerMetrics apply(Map<String, String> from) { public ServerMetrics apply(Map<String, String> from) {
ServerMetrics.Builder metricsBuilder = new ServerMetrics.Builder(); ServerMetrics.Builder metricsBuilder = new ServerMetrics.Builder();
if (from.containsKey("tx:packets")) if (from.containsKey("tx:packets"))
metricsBuilder.txPackets(new Long(from.get("tx:packets"))); metricsBuilder.txPackets(Long.valueOf(from.get("tx:packets")));
if (from.containsKey("tx")) if (from.containsKey("tx"))
metricsBuilder.tx(new Long(from.get("tx"))); metricsBuilder.tx(Long.valueOf(from.get("tx")));
if (from.containsKey("rx:packets")) if (from.containsKey("rx:packets"))
metricsBuilder.rxPackets(new Long(from.get("rx:packets"))); metricsBuilder.rxPackets(Long.valueOf(from.get("rx:packets")));
if (from.containsKey("rx")) if (from.containsKey("rx"))
metricsBuilder.rx(new Long(from.get("rx"))); metricsBuilder.rx(Long.valueOf(from.get("rx")));
metricsBuilder.driveMetrics(mapToDriveMetrics.apply(from)); metricsBuilder.driveMetrics(mapToDriveMetrics.apply(from));
ServerMetrics metrics = metricsBuilder.build(); ServerMetrics metrics = metricsBuilder.build();

View File

@ -103,7 +103,7 @@ public class Account extends ForwardingSet<User> {
} }
public static Type fromValue(String type) { public static Type fromValue(String type) {
Integer code = new Integer(checkNotNull(type, "type")); Integer code = Integer.valueOf(checkNotNull(type, "type"));
return INDEX.containsKey(code) ? INDEX.get(code) : UNRECOGNIZED; return INDEX.containsKey(code) ? INDEX.get(code) : UNRECOGNIZED;
} }
@ -473,7 +473,7 @@ public class Account extends ForwardingSet<User> {
} }
private static Long toLongNullIfUnlimited(String in) { private static Long toLongNullIfUnlimited(String in) {
return in == null || "Unlimited".equals(in) ? null : new Long(in); return in == null || "Unlimited".equals(in) ? null : Long.valueOf(in);
} }
protected Account(String id, @Nullable Account.Type type, @Nullable String networkDomain, @Nullable String domain, protected Account(String id, @Nullable Account.Type type, @Nullable String networkDomain, @Nullable String domain,

View File

@ -75,7 +75,7 @@ public class Capacity implements Comparable<Capacity> {
} }
public static Type fromValue(String type) { public static Type fromValue(String type) {
Integer code = new Integer(checkNotNull(type, "type")); Integer code = Integer.valueOf(checkNotNull(type, "type"));
return INDEX.containsKey(code) ? INDEX.get(code) : UNRECOGNIZED; return INDEX.containsKey(code) ? INDEX.get(code) : UNRECOGNIZED;
} }
} }

View File

@ -91,7 +91,7 @@ public class ResourceLimit {
} }
public static ResourceType fromValue(String resourceType) { public static ResourceType fromValue(String resourceType) {
Integer code = new Integer(checkNotNull(resourceType, "resourcetype")); Integer code = Integer.valueOf(checkNotNull(resourceType, "resourcetype"));
return INDEX.containsKey(code) ? INDEX.get(code) : UNRECOGNIZED; return INDEX.containsKey(code) ? INDEX.get(code) : UNRECOGNIZED;
} }
} }

View File

@ -80,7 +80,7 @@ public class UsageRecord {
} }
public static UsageType fromValue(String usageType) { public static UsageType fromValue(String usageType) {
Integer code = new Integer(checkNotNull(usageType, "usageType")); Integer code = Integer.valueOf(checkNotNull(usageType, "usageType"));
return INDEX.containsKey(code) ? INDEX.get(code) : UNRECOGNIZED; return INDEX.containsKey(code) ? INDEX.get(code) : UNRECOGNIZED;
} }

View File

@ -108,7 +108,7 @@ public class Volume {
} }
public static Type fromValue(String resourceType) { public static Type fromValue(String resourceType) {
Integer code = new Integer(checkNotNull(resourceType, "resourcetype")); Integer code = Integer.valueOf(checkNotNull(resourceType, "resourcetype"));
return INDEX.containsKey(code) ? INDEX.get(code) : UNRECOGNIZED; return INDEX.containsKey(code) ? INDEX.get(code) : UNRECOGNIZED;
} }

View File

@ -87,7 +87,7 @@ public class HardwarePropertyHandler extends ParseSax.HandlerWithResult<Hardware
if (DOUBLE.matcher(in).matches()) if (DOUBLE.matcher(in).matches())
return new Double(in); return new Double(in);
else if (LONG.matcher(in).matches()) else if (LONG.matcher(in).matches())
return new Long(in); return Long.valueOf(in);
return null; return null;
} }

View File

@ -65,13 +65,13 @@ public class HardwareProfileHandlerTest {
HardwareProfile expects = new HardwareProfile( HardwareProfile expects = new HardwareProfile(
URI.create("http://localhost:3001/api/hardware_profiles/m1-xlarge"), "m1-xlarge", "m1-xlarge", URI.create("http://localhost:3001/api/hardware_profiles/m1-xlarge"), "m1-xlarge", "m1-xlarge",
ImmutableSet.<HardwareProperty> of( ImmutableSet.<HardwareProperty> of(
new FixedHardwareProperty("cpu", "count", new Long(4)), new FixedHardwareProperty("cpu", "count", Long.valueOf(4)),
new RangeHardwareProperty("memory", "MB", new Long(12288), new HardwareParameter(URI new RangeHardwareProperty("memory", "MB", Long.valueOf(12288), new HardwareParameter(URI
.create("http://localhost:3001/api/instances"), "post", "hwp_memory", "create"), .create("http://localhost:3001/api/instances"), "post", "hwp_memory", "create"),
new Long(12288), new Long(32768)), Long.valueOf(12288), Long.valueOf(32768)),
new EnumHardwareProperty("storage", "GB", new Long(1024), new HardwareParameter(URI new EnumHardwareProperty("storage", "GB", Long.valueOf(1024), new HardwareParameter(URI
.create("http://localhost:3001/api/instances"), "post", "hwp_storage", "create"), .create("http://localhost:3001/api/instances"), "post", "hwp_storage", "create"),
ImmutableSet.<Object> of(new Long(1024), new Long(2048), new Long(4096))), ImmutableSet.<Object> of(Long.valueOf(1024), Long.valueOf(2048), Long.valueOf(4096))),
new FixedHardwareProperty("architecture", "label", "x86_64")) new FixedHardwareProperty("architecture", "label", "x86_64"))
); );
assertEquals(parseHardwareProfile(), expects); assertEquals(parseHardwareProfile(), expects);

View File

@ -50,27 +50,27 @@ public class HardwareProfilesHandlerTest extends BaseHandlerTest {
Set<? extends HardwareProfile> expects = ImmutableSet.of( Set<? extends HardwareProfile> expects = ImmutableSet.of(
new HardwareProfile(URI.create("http://localhost:3001/api/hardware_profiles/m1-small"), "m1-small", new HardwareProfile(URI.create("http://localhost:3001/api/hardware_profiles/m1-small"), "m1-small",
"m1-small", ImmutableSet.<HardwareProperty> of( "m1-small", ImmutableSet.<HardwareProperty> of(
new FixedHardwareProperty("cpu", "count", new Long(1)), new FixedHardwareProperty("memory", new FixedHardwareProperty("cpu", "count", Long.valueOf(1)), new FixedHardwareProperty("memory",
"MB", new Double(1740.8)), new FixedHardwareProperty("storage", "GB", new Long(160)), "MB", new Double(1740.8)), new FixedHardwareProperty("storage", "GB", Long.valueOf(160)),
new FixedHardwareProperty("architecture", "label", "i386"))), new FixedHardwareProperty("architecture", "label", "i386"))),
new HardwareProfile(URI.create("http://localhost:3001/api/hardware_profiles/m1-large"), "m1-large", new HardwareProfile(URI.create("http://localhost:3001/api/hardware_profiles/m1-large"), "m1-large",
"m1-large", ImmutableSet.<HardwareProperty> of( "m1-large", ImmutableSet.<HardwareProperty> of(
new FixedHardwareProperty("cpu", "count", new Long(2)), new FixedHardwareProperty("cpu", "count", Long.valueOf(2)),
new RangeHardwareProperty("memory", "MB", new Long(10240), new HardwareParameter(URI new RangeHardwareProperty("memory", "MB", Long.valueOf(10240), new HardwareParameter(URI
.create("http://localhost:3001/api/instances"), "post", "hwp_memory", "create"), .create("http://localhost:3001/api/instances"), "post", "hwp_memory", "create"),
new Double(7680.0), new Long(15360)), new EnumHardwareProperty("storage", "GB", new Long( new Double(7680.0), Long.valueOf(15360)), new EnumHardwareProperty("storage", "GB", Long.valueOf(
850), new HardwareParameter(URI.create("http://localhost:3001/api/instances"), "post", 850), new HardwareParameter(URI.create("http://localhost:3001/api/instances"), "post",
"hwp_storage", "create"), ImmutableSet.<Object> of(new Long(850), new Long(1024))), "hwp_storage", "create"), ImmutableSet.<Object> of(Long.valueOf(850), Long.valueOf(1024))),
new FixedHardwareProperty("architecture", "label", "x86_64"))), new FixedHardwareProperty("architecture", "label", "x86_64"))),
new HardwareProfile(URI.create("http://localhost:3001/api/hardware_profiles/m1-xlarge"), "m1-xlarge", new HardwareProfile(URI.create("http://localhost:3001/api/hardware_profiles/m1-xlarge"), "m1-xlarge",
"m1-xlarge", ImmutableSet.<HardwareProperty> of( "m1-xlarge", ImmutableSet.<HardwareProperty> of(
new FixedHardwareProperty("cpu", "count", new Long(4)), new FixedHardwareProperty("cpu", "count", Long.valueOf(4)),
new RangeHardwareProperty("memory", "MB", new Long(12288), new HardwareParameter(URI new RangeHardwareProperty("memory", "MB", Long.valueOf(12288), new HardwareParameter(URI
.create("http://localhost:3001/api/instances"), "post", "hwp_memory", "create"), .create("http://localhost:3001/api/instances"), "post", "hwp_memory", "create"),
new Long(12288), new Long(32768)), Long.valueOf(12288), Long.valueOf(32768)),
new EnumHardwareProperty("storage", "GB", new Long(1024), new HardwareParameter(URI new EnumHardwareProperty("storage", "GB", Long.valueOf(1024), new HardwareParameter(URI
.create("http://localhost:3001/api/instances"), "post", "hwp_storage", "create"), .create("http://localhost:3001/api/instances"), "post", "hwp_storage", "create"),
ImmutableSet.<Object> of(new Long(1024), new Long(2048), new Long(4096))), ImmutableSet.<Object> of(Long.valueOf(1024), Long.valueOf(2048), Long.valueOf(4096))),
new FixedHardwareProperty("architecture", "label", "x86_64"))), new FixedHardwareProperty("architecture", "label", "x86_64"))),
new HardwareProfile(URI.create("http://localhost:3001/api/hardware_profiles/opaque"), "opaque", "opaque", new HardwareProfile(URI.create("http://localhost:3001/api/hardware_profiles/opaque"), "opaque", "opaque",
ImmutableSet.<HardwareProperty> of())); ImmutableSet.<HardwareProperty> of()));

View File

@ -65,7 +65,7 @@ public class MapToDriveInfo implements Function<Map<String, String>, DriveInfo>
if (from.containsKey("readers")) if (from.containsKey("readers"))
builder.readers(Splitter.on(' ').split(from.get("readers"))); builder.readers(Splitter.on(' ').split(from.get("readers")));
if (from.containsKey("size")) if (from.containsKey("size"))
builder.size(new Long(from.get("size"))); builder.size(Long.valueOf(from.get("size")));
Map<String, String> metadata = Maps.newLinkedHashMap(); Map<String, String> metadata = Maps.newLinkedHashMap();
for (Entry<String, String> entry : from.entrySet()) { for (Entry<String, String> entry : from.entrySet()) {
if (entry.getKey().startsWith("user:")) if (entry.getKey().startsWith("user:"))
@ -83,13 +83,13 @@ public class MapToDriveInfo implements Function<Map<String, String>, DriveInfo>
protected DriveMetrics buildMetrics(Map<String, String> from) { protected DriveMetrics buildMetrics(Map<String, String> from) {
DriveMetrics.Builder metricsBuilder = new DriveMetrics.Builder(); DriveMetrics.Builder metricsBuilder = new DriveMetrics.Builder();
if (from.containsKey("read:bytes")) if (from.containsKey("read:bytes"))
metricsBuilder.readBytes(new Long(from.get("read:bytes"))); metricsBuilder.readBytes(Long.valueOf(from.get("read:bytes")));
if (from.containsKey("read:requests")) if (from.containsKey("read:requests"))
metricsBuilder.readRequests(new Long(from.get("read:requests"))); metricsBuilder.readRequests(Long.valueOf(from.get("read:requests")));
if (from.containsKey("write:bytes")) if (from.containsKey("write:bytes"))
metricsBuilder.writeBytes(new Long(from.get("write:bytes"))); metricsBuilder.writeBytes(Long.valueOf(from.get("write:bytes")));
if (from.containsKey("write:requests")) if (from.containsKey("write:requests"))
metricsBuilder.writeRequests(new Long(from.get("write:requests"))); metricsBuilder.writeRequests(Long.valueOf(from.get("write:requests")));
return metricsBuilder.build(); return metricsBuilder.build();
} }
} }

View File

@ -74,13 +74,13 @@ public class MapToDriveMetrics implements Function<Map<String, String>, Map<Stri
protected DriveMetrics buildMetrics(String key, Map<String, String> from) { protected DriveMetrics buildMetrics(String key, Map<String, String> from) {
DriveMetrics.Builder builder = new DriveMetrics.Builder(); DriveMetrics.Builder builder = new DriveMetrics.Builder();
if (from.containsKey(key + ":read:bytes")) if (from.containsKey(key + ":read:bytes"))
builder.readBytes(new Long(from.get(key + ":read:bytes"))); builder.readBytes(Long.valueOf(from.get(key + ":read:bytes")));
if (from.containsKey(key + ":read:requests")) if (from.containsKey(key + ":read:requests"))
builder.readRequests(new Long(from.get(key + ":read:requests"))); builder.readRequests(Long.valueOf(from.get(key + ":read:requests")));
if (from.containsKey(key + ":write:bytes")) if (from.containsKey(key + ":write:bytes"))
builder.writeBytes(new Long(from.get(key + ":write:bytes"))); builder.writeBytes(Long.valueOf(from.get(key + ":write:bytes")));
if (from.containsKey(key + ":write:requests")) if (from.containsKey(key + ":write:requests"))
builder.writeRequests(new Long(from.get(key + ":write:requests"))); builder.writeRequests(Long.valueOf(from.get(key + ":write:requests")));
return builder.build(); return builder.build();
} }
} }

View File

@ -68,16 +68,16 @@ public class MapToServerInfo implements Function<Map<String, String>, ServerInfo
if (from.containsKey("smp:cores")) { if (from.containsKey("smp:cores")) {
builder.smp(new Integer(from.get("smp:cores"))); builder.smp(Integer.valueOf(from.get("smp:cores")));
} else if (from.containsKey("smp") && !"auto".equals(from.get("smp"))) { } else if (from.containsKey("smp") && !"auto".equals(from.get("smp"))) {
builder.smp(new Integer(from.get("smp"))); builder.smp(Integer.valueOf(from.get("smp")));
} }
builder.cpu(Integer.parseInt(from.get("cpu"))); builder.cpu(Integer.parseInt(from.get("cpu")));
builder.mem(Integer.parseInt(from.get("mem"))); builder.mem(Integer.parseInt(from.get("mem")));
builder.user(from.get("user")); builder.user(from.get("user"));
if (from.containsKey("started")) if (from.containsKey("started"))
builder.started(new Date(new Long(from.get("started")))); builder.started(new Date(Long.valueOf(from.get("started"))));
builder.uuid(from.get("server")); builder.uuid(from.get("server"));
if (from.containsKey("boot")) if (from.containsKey("boot"))
builder.bootDeviceIds(Splitter.on(' ').split(from.get("boot"))); builder.bootDeviceIds(Splitter.on(' ').split(from.get("boot")));

View File

@ -44,13 +44,13 @@ public class MapToServerMetrics implements Function<Map<String, String>, ServerM
public ServerMetrics apply(Map<String, String> from) { public ServerMetrics apply(Map<String, String> from) {
ServerMetrics.Builder metricsBuilder = new ServerMetrics.Builder(); ServerMetrics.Builder metricsBuilder = new ServerMetrics.Builder();
if (from.containsKey("tx:packets")) if (from.containsKey("tx:packets"))
metricsBuilder.txPackets(new Long(from.get("tx:packets"))); metricsBuilder.txPackets(Long.valueOf(from.get("tx:packets")));
if (from.containsKey("tx")) if (from.containsKey("tx"))
metricsBuilder.tx(new Long(from.get("tx"))); metricsBuilder.tx(Long.valueOf(from.get("tx")));
if (from.containsKey("rx:packets")) if (from.containsKey("rx:packets"))
metricsBuilder.rxPackets(new Long(from.get("rx:packets"))); metricsBuilder.rxPackets(Long.valueOf(from.get("rx:packets")));
if (from.containsKey("rx")) if (from.containsKey("rx"))
metricsBuilder.rx(new Long(from.get("rx"))); metricsBuilder.rx(Long.valueOf(from.get("rx")));
metricsBuilder.driveMetrics(mapToDriveMetrics.apply(from)); metricsBuilder.driveMetrics(mapToDriveMetrics.apply(from));
ServerMetrics metrics = metricsBuilder.build(); ServerMetrics metrics = metricsBuilder.build();

View File

@ -567,7 +567,7 @@ public class FilesystemAsyncBlobStore extends BaseAsyncBlobStore {
byte[] byteArray = out.toByteArray(); byte[] byteArray = out.toByteArray();
blob.setPayload(byteArray); blob.setPayload(byteArray);
HttpUtils.copy(cmd, blob.getPayload().getContentMetadata()); HttpUtils.copy(cmd, blob.getPayload().getContentMetadata());
blob.getPayload().getContentMetadata().setContentLength(new Long(byteArray.length)); blob.getPayload().getContentMetadata().setContentLength(Long.valueOf(byteArray.length));
} }
} }
checkNotNull(blob.getPayload(), "payload " + blob); checkNotNull(blob.getPayload(), "payload " + blob);

View File

@ -656,7 +656,7 @@ public class FilesystemAsyncBlobStoreTest {
assertEquals(metadata.getUserMetadata().size(), 0, "Wrong blob UserMetadata"); assertEquals(metadata.getUserMetadata().size(), 0, "Wrong blob UserMetadata");
// metadata.getLastModified() // metadata.getLastModified()
File file = new File(TARGET_CONTAINER_NAME + File.separator + BLOB_KEY); File file = new File(TARGET_CONTAINER_NAME + File.separator + BLOB_KEY);
assertEquals(metadata.getContentMetadata().getContentLength(), new Long(file.length()), "Wrong blob size"); assertEquals(metadata.getContentMetadata().getContentLength(), Long.valueOf(file.length()), "Wrong blob size");
} }
public void testDeleteContainer_NotExistingContainer() { public void testDeleteContainer_NotExistingContainer() {

View File

@ -264,8 +264,8 @@ public class NovaClientLiveTest extends BaseComputeServiceContextLiveTest {
assertNotNull(server.getHostId()); assertNotNull(server.getHostId());
assertEquals(server.getStatus(), ServerStatus.ACTIVE); assertEquals(server.getStatus(), ServerStatus.ACTIVE);
assert server.getProgress() >= 0 : "newDetails.getProgress()" + server.getProgress(); assert server.getProgress() >= 0 : "newDetails.getProgress()" + server.getProgress();
assertEquals(new Integer(14362), server.getImage()); assertEquals(Integer.valueOf(14362), server.getImage());
assertEquals(new Integer(1), server.getFlavor()); assertEquals(Integer.valueOf(1), server.getFlavor());
assertNotNull(server.getAddresses()); assertNotNull(server.getAddresses());
// listAddresses tests.. // listAddresses tests..
assertEquals(client.getAddresses(serverId), server.getAddresses()); assertEquals(client.getAddresses(serverId), server.getAddresses());
@ -332,7 +332,7 @@ public class NovaClientLiveTest extends BaseComputeServiceContextLiveTest {
public void testCreateImage() throws Exception { public void testCreateImage() throws Exception {
Image image = client.createImageFromServer("hoofie", serverId); Image image = client.createImageFromServer("hoofie", serverId);
assertEquals("hoofie", image.getName()); assertEquals("hoofie", image.getName());
assertEquals(new Integer(serverId), image.getServerRef()); assertEquals(Integer.valueOf(serverId), image.getServerRef());
createdImageRef = image.getId()+""; createdImageRef = image.getId()+"";
blockUntilImageActive(createdImageRef); blockUntilImageActive(createdImageRef);
} }
@ -341,7 +341,7 @@ public class NovaClientLiveTest extends BaseComputeServiceContextLiveTest {
public void testRebuildServer() throws Exception { public void testRebuildServer() throws Exception {
client.rebuildServer(serverId, new RebuildServerOptions().withImage(createdImageRef)); client.rebuildServer(serverId, new RebuildServerOptions().withImage(createdImageRef));
blockUntilServerActive(serverId); blockUntilServerActive(serverId);
assertEquals(new Integer(createdImageRef).intValue(),client.getServer(serverId).getImage().getId()); assertEquals(Integer.valueOf(createdImageRef).intValue(),client.getServer(serverId).getImage().getId());
} }
@Test(timeOut = 10 * 60 * 1000, dependsOnMethods = "testRebuildServer") @Test(timeOut = 10 * 60 * 1000, dependsOnMethods = "testRebuildServer")
@ -362,7 +362,7 @@ public class NovaClientLiveTest extends BaseComputeServiceContextLiveTest {
blockUntilServerVerifyResize(serverId); blockUntilServerVerifyResize(serverId);
client.revertResizeServer(serverId); client.revertResizeServer(serverId);
blockUntilServerActive(serverId); blockUntilServerActive(serverId);
assertEquals(new Integer(1), client.getServer(serverId).getFlavorRef()); assertEquals(Integer.valueOf(1), client.getServer(serverId).getFlavorRef());
} }
@Test(timeOut = 10 * 60 * 1000, dependsOnMethods = "testRebootSoft") @Test(timeOut = 10 * 60 * 1000, dependsOnMethods = "testRebootSoft")
@ -371,7 +371,7 @@ public class NovaClientLiveTest extends BaseComputeServiceContextLiveTest {
blockUntilServerVerifyResize(serverId2); blockUntilServerVerifyResize(serverId2);
client.confirmResizeServer(serverId2); client.confirmResizeServer(serverId2);
blockUntilServerActive(serverId2); blockUntilServerActive(serverId2);
assertEquals(new Integer(2), client.getServer(serverId2).getFlavorRef()); assertEquals(Integer.valueOf(2), client.getServer(serverId2).getFlavorRef());
} }
@Test(timeOut = 10 * 60 * 1000, dependsOnMethods = { "testRebootSoft", "testRevertResize", "testConfirmResize" }) @Test(timeOut = 10 * 60 * 1000, dependsOnMethods = { "testRebootSoft", "testRevertResize", "testConfirmResize" })

View File

@ -64,7 +64,7 @@ public class ParseImageFromJsonResponseTest {
assertEquals(response.getId(), 2); assertEquals(response.getId(), 2);
assertEquals(response.getName(), "CentOS 5.2"); assertEquals(response.getName(), "CentOS 5.2");
assertEquals(response.getCreated(), dateService.iso8601SecondsDateParse("2010-08-10T12:00:00Z")); assertEquals(response.getCreated(), dateService.iso8601SecondsDateParse("2010-08-10T12:00:00Z"));
assertEquals(response.getProgress(), new Integer(80)); assertEquals(response.getProgress(), Integer.valueOf(80));
assertEquals(response.getStatus(), ImageStatus.SAVING); assertEquals(response.getStatus(), ImageStatus.SAVING);
assertEquals(response.getUpdated(), dateService.iso8601SecondsDateParse(("2010-10-10T12:00:00Z"))); assertEquals(response.getUpdated(), dateService.iso8601SecondsDateParse(("2010-10-10T12:00:00Z")));
assertEquals(response.getServerRef(), "http://servers.api.openstack.org/v1.1/1234/servers/12"); assertEquals(response.getServerRef(), "http://servers.api.openstack.org/v1.1/1234/servers/12");

View File

@ -96,7 +96,7 @@ public class ParseImageListFromJsonResponseTest {
assertEquals(response.get(1).getName(), "My Server Backup"); assertEquals(response.get(1).getName(), "My Server Backup");
assertEquals(response.get(1).getCreated(), dateService.iso8601SecondsDateParse("2009-07-07T09:56:16Z")); assertEquals(response.get(1).getCreated(), dateService.iso8601SecondsDateParse("2009-07-07T09:56:16Z"));
assertEquals(response.get(1).getProgress(), new Integer(80)); assertEquals(response.get(1).getProgress(), Integer.valueOf(80));
assertEquals(response.get(1).getStatus(), ImageStatus.SAVING); assertEquals(response.get(1).getStatus(), ImageStatus.SAVING);
assertEquals(response.get(1).getUpdated(), dateService.iso8601SecondsDateParse("2010-10-10T12:00:00Z")); assertEquals(response.get(1).getUpdated(), dateService.iso8601SecondsDateParse("2010-10-10T12:00:00Z"));
assertEquals(response.get(1).getServerRef(), "http://servers.api.openstack.org/v1.1/1234/servers/12"); assertEquals(response.get(1).getServerRef(), "http://servers.api.openstack.org/v1.1/1234/servers/12");

View File

@ -64,7 +64,7 @@ public class ParseServerFromJsonResponseDiabloTest {
assertEquals(response.getFlavor().getURI(), new URI("http://servers.api.openstack.org/1234/flavors/1")); assertEquals(response.getFlavor().getURI(), new URI("http://servers.api.openstack.org/1234/flavors/1"));
assertEquals(response.getHostId(), "e4d909c290d0fb1ca068ffaddf22cbd0"); assertEquals(response.getHostId(), "e4d909c290d0fb1ca068ffaddf22cbd0");
assertEquals(response.getStatus(), ServerStatus.BUILD); assertEquals(response.getStatus(), ServerStatus.BUILD);
assertEquals(response.getProgress(), new Integer(60)); assertEquals(response.getProgress(), Integer.valueOf(60));
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US);
dateFormat.setTimeZone(new SimpleTimeZone(0, "GMT")); dateFormat.setTimeZone(new SimpleTimeZone(0, "GMT"));
assertEquals(response.getCreated(), dateFormat.parse("2010-08-10T12:00:00Z")); assertEquals(response.getCreated(), dateFormat.parse("2010-08-10T12:00:00Z"));

View File

@ -65,7 +65,7 @@ public class ParseServerFromJsonResponseTest {
assertEquals(response.getFlavorRef(), "http://servers.api.openstack.org/1234/flavors/1"); assertEquals(response.getFlavorRef(), "http://servers.api.openstack.org/1234/flavors/1");
assertEquals(response.getHostId(), "e4d909c290d0fb1ca068ffaddf22cbd0"); assertEquals(response.getHostId(), "e4d909c290d0fb1ca068ffaddf22cbd0");
assertEquals(response.getStatus(), ServerStatus.BUILD); assertEquals(response.getStatus(), ServerStatus.BUILD);
assertEquals(response.getProgress(), new Integer(60)); assertEquals(response.getProgress(), Integer.valueOf(60));
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US);
dateFormat.setTimeZone(new SimpleTimeZone(0, "GMT")); dateFormat.setTimeZone(new SimpleTimeZone(0, "GMT"));
assertEquals(response.getCreated(), dateFormat.parse("2010-08-10T12:00:00Z")); assertEquals(response.getCreated(), dateFormat.parse("2010-08-10T12:00:00Z"));

View File

@ -88,7 +88,7 @@ public class ParseServerListFromJsonResponseTest {
assertEquals(response.get(0).getHostId(), "e4d909c290d0fb1ca068ffaddf22cbd0"); assertEquals(response.get(0).getHostId(), "e4d909c290d0fb1ca068ffaddf22cbd0");
assertEquals(response.get(0).getUuid(), "d84e2086-fc0d-11e0-8e08-2837371c69ae"); assertEquals(response.get(0).getUuid(), "d84e2086-fc0d-11e0-8e08-2837371c69ae");
assertEquals(response.get(0).getStatus(), ServerStatus.BUILD); assertEquals(response.get(0).getStatus(), ServerStatus.BUILD);
assertEquals(response.get(0).getProgress(), new Integer(60)); assertEquals(response.get(0).getProgress(), Integer.valueOf(60));
List<Address> publicAddresses = ImmutableList.copyOf(Iterables.transform( List<Address> publicAddresses = ImmutableList.copyOf(Iterables.transform(
ImmutableList.of("67.23.10.132", "::babe:67.23.10.132", "67.23.10.131", "::babe:4317:0A83"), ImmutableList.of("67.23.10.132", "::babe:67.23.10.132", "67.23.10.131", "::babe:4317:0A83"),

View File

@ -85,7 +85,7 @@ public class ListBucketOptions extends BaseHttpRequestOptions {
public Integer getMaxResults() { public Integer getMaxResults() {
String returnVal = getFirstQueryOrNull("max-keys"); String returnVal = getFirstQueryOrNull("max-keys");
return (returnVal != null) ? new Integer(returnVal) : null; return (returnVal != null) ? Integer.valueOf(returnVal) : null;
} }
/** /**

View File

@ -104,7 +104,7 @@ public class ListBucketHandler extends ParseSax.HandlerWithResult<ListBucketResp
builder.eTag(currentETag); builder.eTag(currentETag);
builder.contentMD5(CryptoStreams.hex(Strings2.replaceAll(currentETag, '"', ""))); builder.contentMD5(CryptoStreams.hex(Strings2.replaceAll(currentETag, '"', "")));
} else if (qName.equals("Size")) { } else if (qName.equals("Size")) {
builder.contentLength(new Long(currentOrNull(currentText))); builder.contentLength(Long.valueOf(currentOrNull(currentText)));
} else if (qName.equals("Owner")) { } else if (qName.equals("Owner")) {
builder.owner(currentOwner); builder.owner(currentOwner);
currentOwner = null; currentOwner = null;

View File

@ -164,7 +164,7 @@ public class ParallelMultipartUploadStrategy implements AsyncMultipartUploadStra
CountDownLatch latch = new CountDownLatch(effectiveParts); CountDownLatch latch = new CountDownLatch(effectiveParts);
int part; int part;
while ((part = algorithm.getNextPart()) <= parts) { while ((part = algorithm.getNextPart()) <= parts) {
Integer partKey = new Integer(part); Integer partKey = Integer.valueOf(part);
activeParts.put(partKey); activeParts.put(partKey);
prepareUploadPart(container, blob, key, partKey, payload, prepareUploadPart(container, blob, key, partKey, payload,
@ -173,7 +173,7 @@ public class ParallelMultipartUploadStrategy implements AsyncMultipartUploadStra
blob2Object); blob2Object);
} }
if (remaining > 0) { if (remaining > 0) {
Integer partKey = new Integer(part); Integer partKey = Integer.valueOf(part);
activeParts.put(partKey); activeParts.put(partKey);
prepareUploadPart(container, blob, key, partKey, payload, prepareUploadPart(container, blob, key, partKey, payload,
algorithm.getNextChunkOffset(), remaining, etags, algorithm.getNextChunkOffset(), remaining, etags,
@ -187,7 +187,7 @@ public class ParallelMultipartUploadStrategy implements AsyncMultipartUploadStra
CountDownLatch retryLatch = new CountDownLatch(atOnce); CountDownLatch retryLatch = new CountDownLatch(atOnce);
for (int i = 0; i < atOnce; i++) { for (int i = 0; i < atOnce; i++) {
Part failedPart = toRetry.poll(); Part failedPart = toRetry.poll();
Integer partKey = new Integer(failedPart.getPart()); Integer partKey = Integer.valueOf(failedPart.getPart());
activeParts.put(partKey); activeParts.put(partKey);
prepareUploadPart(container, blob, key, partKey, payload, prepareUploadPart(container, blob, key, partKey, payload,
failedPart.getOffset(), failedPart.getSize(), etags, failedPart.getOffset(), failedPart.getSize(), etags,

View File

@ -57,7 +57,7 @@ public class ListContainerOptions extends BaseHttpRequestOptions {
public int getMaxResults() { public int getMaxResults() {
String val = getFirstQueryOrNull("limit"); String val = getFirstQueryOrNull("limit");
return val != null ? new Integer(val) : 10000; return val != null ? Integer.valueOf(val) : 10000;
} }
/** /**

View File

@ -204,7 +204,7 @@ public abstract class CommonSwiftClientLiveTest<C extends CommonSwiftClient> ext
MutableObjectInfoWithMetadata metadata = getApi().getObjectInfo(containerName, object.getInfo().getName()); MutableObjectInfoWithMetadata metadata = getApi().getObjectInfo(containerName, object.getInfo().getName());
assertEquals(metadata.getName(), object.getInfo().getName()); assertEquals(metadata.getName(), object.getInfo().getName());
assertEquals(metadata.getBytes(), new Long(data.length())); assertEquals(metadata.getBytes(), Long.valueOf(data.length()));
assert metadata.getContentType().startsWith("text/plain") : metadata.getContentType(); assert metadata.getContentType().startsWith("text/plain") : metadata.getContentType();
assertEquals(CryptoStreams.hex(md5), CryptoStreams.hex(metadata.getHash())); assertEquals(CryptoStreams.hex(md5), CryptoStreams.hex(metadata.getHash()));
@ -225,7 +225,7 @@ public abstract class CommonSwiftClientLiveTest<C extends CommonSwiftClient> ext
assertEquals(Strings2.toString(getBlob.getPayload()), data); assertEquals(Strings2.toString(getBlob.getPayload()), data);
// TODO assertEquals(getBlob.getName(), // TODO assertEquals(getBlob.getName(),
// object.getMetadata().getName()); // object.getMetadata().getName());
assertEquals(getBlob.getInfo().getBytes(), new Long(data.length())); assertEquals(getBlob.getInfo().getBytes(), Long.valueOf(data.length()));
testGetObjectContentType(getBlob); testGetObjectContentType(getBlob);
assertEquals(CryptoStreams.hex(md5), CryptoStreams.hex(getBlob.getInfo().getHash())); assertEquals(CryptoStreams.hex(md5), CryptoStreams.hex(getBlob.getInfo().getHash()));
assertEquals(CryptoStreams.hex(newEtag), getBlob.getInfo().getHash()); assertEquals(CryptoStreams.hex(newEtag), getBlob.getInfo().getHash());

View File

@ -85,7 +85,7 @@ public class NetworkConnectionSectionHandler extends ParseSax.HandlerWithResult<
} else if (qName.endsWith("Info")) { } else if (qName.endsWith("Info")) {
this.info = currentOrNull(); this.info = currentOrNull();
} else if (qName.endsWith("PrimaryNetworkConnectionIndex")) { } else if (qName.endsWith("PrimaryNetworkConnectionIndex")) {
this.primaryNetworkConnectionIndex = new Integer(currentOrNull()); this.primaryNetworkConnectionIndex = Integer.valueOf(currentOrNull());
} }
currentText = new StringBuilder(); currentText = new StringBuilder();
} }

View File

@ -55,18 +55,18 @@ public class GuestCustomizationSectionHandlerTest extends BaseHandlerTest {
assertEquals(result.getHref(), assertEquals(result.getHref(),
URI.create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/guestCustomizationSection/")); URI.create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/guestCustomizationSection/"));
assertEquals(result.getInfo(), "Specifies Guest OS Customization Settings"); assertEquals(result.getInfo(), "Specifies Guest OS Customization Settings");
assertEquals(result.isEnabled(), new Boolean(true)); assertEquals(result.isEnabled(), Boolean.TRUE);
assertEquals(result.shouldChangeSid(), new Boolean(false)); assertEquals(result.shouldChangeSid(), Boolean.FALSE);
assertEquals(result.getVirtualMachineId(), "2087535248"); assertEquals(result.getVirtualMachineId(), "2087535248");
assertEquals(result.isJoinDomainEnabled(), new Boolean(false)); assertEquals(result.isJoinDomainEnabled(), Boolean.FALSE);
assertEquals(result.useOrgSettings(), new Boolean(false)); assertEquals(result.useOrgSettings(), Boolean.FALSE);
assertEquals(result.getDomainName(), null); assertEquals(result.getDomainName(), null);
assertEquals(result.getDomainUserName(), null); assertEquals(result.getDomainUserName(), null);
assertEquals(result.getDomainUserPassword(), null); assertEquals(result.getDomainUserPassword(), null);
assertEquals(result.isAdminPasswordEnabled(), new Boolean(true)); assertEquals(result.isAdminPasswordEnabled(), Boolean.TRUE);
assertEquals(result.isAdminPasswordAuto(), new Boolean(true)); assertEquals(result.isAdminPasswordAuto(), Boolean.TRUE);
assertEquals(result.getAdminPassword(), null); assertEquals(result.getAdminPassword(), null);
assertEquals(result.isResetPasswordRequired(), new Boolean(false)); assertEquals(result.isResetPasswordRequired(), Boolean.FALSE);
assertEquals(result.getCustomizationScript(), "cat > /root/foo.txt<<EOF\nI '\"love\"' {asc|!}*&\nEOF\n"); assertEquals(result.getCustomizationScript(), "cat > /root/foo.txt<<EOF\nI '\"love\"' {asc|!}*&\nEOF\n");
assertEquals(result.getComputerName(), "RHEL5"); assertEquals(result.getComputerName(), "RHEL5");
assertEquals( assertEquals(

View File

@ -57,7 +57,7 @@ public class NetworkConnectionSectionHandlerTest {
.create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/networkConnectionSection/")); .create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/networkConnectionSection/"));
assertEquals(result.getType(), VCloudMediaType.NETWORKCONNECTIONSECTION_XML); assertEquals(result.getType(), VCloudMediaType.NETWORKCONNECTIONSECTION_XML);
assertEquals(result.getInfo(), "Specifies the available VM network connections"); assertEquals(result.getInfo(), "Specifies the available VM network connections");
assertEquals(result.getPrimaryNetworkConnectionIndex(), new Integer(0)); assertEquals(result.getPrimaryNetworkConnectionIndex(), Integer.valueOf(0));
assertEquals(result.getEdit(), new ReferenceTypeImpl(null, VCloudMediaType.NETWORKCONNECTIONSECTION_XML, URI assertEquals(result.getEdit(), new ReferenceTypeImpl(null, VCloudMediaType.NETWORKCONNECTIONSECTION_XML, URI
.create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/networkConnectionSection/"))); .create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/networkConnectionSection/")));
NetworkConnectionHandlerTest.checkNetworkConnection(Iterables.getOnlyElement(result.getConnections())); NetworkConnectionHandlerTest.checkNetworkConnection(Iterables.getOnlyElement(result.getConnections()));

View File

@ -86,18 +86,18 @@ public class VAppTemplateHandlerTest {
URI URI
.create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/vm-172837194/guestCustomizationSection/")); .create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/vm-172837194/guestCustomizationSection/"));
assertEquals(guestC.getInfo(), "Specifies Guest OS Customization Settings"); assertEquals(guestC.getInfo(), "Specifies Guest OS Customization Settings");
assertEquals(guestC.isEnabled(), new Boolean(true)); assertEquals(guestC.isEnabled(), Boolean.TRUE);
assertEquals(guestC.shouldChangeSid(), new Boolean(false)); assertEquals(guestC.shouldChangeSid(), Boolean.FALSE);
assertEquals(guestC.getVirtualMachineId(), "172837194"); assertEquals(guestC.getVirtualMachineId(), "172837194");
assertEquals(guestC.isJoinDomainEnabled(), new Boolean(false)); assertEquals(guestC.isJoinDomainEnabled(), Boolean.FALSE);
assertEquals(guestC.useOrgSettings(), new Boolean(false)); assertEquals(guestC.useOrgSettings(), Boolean.FALSE);
assertEquals(guestC.getDomainName(), null); assertEquals(guestC.getDomainName(), null);
assertEquals(guestC.getDomainUserName(), null); assertEquals(guestC.getDomainUserName(), null);
assertEquals(guestC.getDomainUserPassword(), null); assertEquals(guestC.getDomainUserPassword(), null);
assertEquals(guestC.isAdminPasswordEnabled(), new Boolean(true)); assertEquals(guestC.isAdminPasswordEnabled(), Boolean.TRUE);
assertEquals(guestC.isAdminPasswordAuto(), new Boolean(true)); assertEquals(guestC.isAdminPasswordAuto(), Boolean.TRUE);
assertEquals(guestC.getAdminPassword(), "%3eD%gmF"); assertEquals(guestC.getAdminPassword(), "%3eD%gmF");
assertEquals(guestC.isResetPasswordRequired(), new Boolean(false)); assertEquals(guestC.isResetPasswordRequired(), Boolean.FALSE);
assertEquals( assertEquals(
guestC.getCustomizationScript(), guestC.getCustomizationScript(),
"#!/bin/bash if [ \"$1\" = \"postcustomization\" ]; then echo \"post customization\" touch /root/.postcustomization sleep 30 #regenerate keys /bin/rm /etc/ssh/ssh_host_* /usr/sbin/dpkg-reconfigure openssh-server echo \"completed\" fi"); "#!/bin/bash if [ \"$1\" = \"postcustomization\" ]; then echo \"post customization\" touch /root/.postcustomization sleep 30 #regenerate keys /bin/rm /etc/ssh/ssh_host_* /usr/sbin/dpkg-reconfigure openssh-server echo \"completed\" fi");

View File

@ -55,7 +55,7 @@ public class VCloudOperatingSystemSectionHandlerTest extends BaseHandlerTest {
assertEquals(result.getEdit(), new ReferenceTypeImpl(null, assertEquals(result.getEdit(), new ReferenceTypeImpl(null,
"application/vnd.vmware.vcloud.operatingSystemSection+xml", "application/vnd.vmware.vcloud.operatingSystemSection+xml",
URI.create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/operatingSystemSection/"))); URI.create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/operatingSystemSection/")));
assertEquals(result.getId(), new Integer(80)); assertEquals(result.getId(), Integer.valueOf(80));
assertEquals(result.getVmwOsType(), "rhel5_64Guest"); assertEquals(result.getVmwOsType(), "rhel5_64Guest");
assertEquals(result.getType(), "application/vnd.vmware.vcloud.operatingSystemSection+xml"); assertEquals(result.getType(), "application/vnd.vmware.vcloud.operatingSystemSection+xml");
assertEquals(result.getInfo(), "Specifies the operating system installed"); assertEquals(result.getInfo(), "Specifies the operating system installed");

View File

@ -628,7 +628,7 @@ public class TransientAsyncBlobStore extends BaseAsyncBlobStore {
byte[] byteArray = out.toByteArray(); byte[] byteArray = out.toByteArray();
blob.setPayload(byteArray); blob.setPayload(byteArray);
HttpUtils.copy(cmd, blob.getPayload().getContentMetadata()); HttpUtils.copy(cmd, blob.getPayload().getContentMetadata());
blob.getPayload().getContentMetadata().setContentLength(new Long(byteArray.length)); blob.getPayload().getContentMetadata().setContentLength(Long.valueOf(byteArray.length));
} }
} }
checkNotNull(blob.getPayload(), "payload " + blob); checkNotNull(blob.getPayload(), "payload " + blob);

View File

@ -66,7 +66,7 @@ public class BindBlobToMultipartFormTest {
binder.bindToRequest(request, TEST_BLOB); binder.bindToRequest(request, TEST_BLOB);
assertEquals(Strings2.toString(request.getPayload()), EXPECTS); assertEquals(Strings2.toString(request.getPayload()), EXPECTS);
assertEquals(request.getPayload().getContentMetadata().getContentLength(), new Long(113)); assertEquals(request.getPayload().getContentMetadata().getContentLength(), Long.valueOf(113));
assertEquals(request.getPayload().getContentMetadata().getContentType(), "multipart/form-data; boundary=" assertEquals(request.getPayload().getContentMetadata().getContentType(), "multipart/form-data; boundary="
+ BOUNDARY); + BOUNDARY);

View File

@ -85,7 +85,7 @@ public class ParseBlobFromHeadersAndHttpContentTest {
replay(metadataParser); replay(metadataParser);
Blob object = callable.apply(response); Blob object = callable.apply(response);
assertEquals(object.getPayload().getContentMetadata().getContentLength(), new Long(10485760)); assertEquals(object.getPayload().getContentMetadata().getContentLength(), Long.valueOf(10485760));
assertEquals(object.getAllHeaders().get("Content-Range"), Collections.singletonList("0-10485759/20232760")); assertEquals(object.getAllHeaders().get("Content-Range"), Collections.singletonList("0-10485759/20232760"));
} }

View File

@ -33,7 +33,7 @@ public class ReturnFalseOnContainerNotFoundTest {
@Test @Test
public void testFoundIsFalse() throws SecurityException, NoSuchMethodException { public void testFoundIsFalse() throws SecurityException, NoSuchMethodException {
assertEquals(fn.apply(new ContainerNotFoundException()), new Boolean(false)); assertEquals(fn.apply(new ContainerNotFoundException()), Boolean.FALSE);
} }
@Test(expectedExceptions = { RuntimeException.class }) @Test(expectedExceptions = { RuntimeException.class })

View File

@ -33,7 +33,7 @@ public class ReturnFalseOnKeyNotFoundTest {
@Test @Test
public void testFoundIsFalse() throws SecurityException, NoSuchMethodException { public void testFoundIsFalse() throws SecurityException, NoSuchMethodException {
assertEquals(fn.apply(new KeyNotFoundException()), new Boolean(false)); assertEquals(fn.apply(new KeyNotFoundException()), Boolean.FALSE);
} }
@Test(expectedExceptions = { RuntimeException.class }) @Test(expectedExceptions = { RuntimeException.class })

View File

@ -637,7 +637,7 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
protected void validateMetadata(BlobMetadata metadata) throws IOException { protected void validateMetadata(BlobMetadata metadata) throws IOException {
assert metadata.getContentMetadata().getContentType().startsWith("text/plain") : metadata.getContentMetadata() assert metadata.getContentMetadata().getContentType().startsWith("text/plain") : metadata.getContentMetadata()
.getContentType(); .getContentType();
assertEquals(metadata.getContentMetadata().getContentLength(), new Long(TEST_STRING.length())); assertEquals(metadata.getContentMetadata().getContentLength(), Long.valueOf(TEST_STRING.length()));
assertEquals(metadata.getUserMetadata().get("adrian"), "powderpuff"); assertEquals(metadata.getUserMetadata().get("adrian"), "powderpuff");
checkMD5(metadata); checkMD5(metadata);
} }

View File

@ -88,7 +88,7 @@ public class BaseContainerIntegrationTest extends BaseBlobStoreIntegrationTest {
assert metadata.getContentMetadata().getContentType().startsWith("text/plain") : metadata.getContentMetadata() assert metadata.getContentMetadata().getContentType().startsWith("text/plain") : metadata.getContentMetadata()
.getContentType(); .getContentType();
assertEquals(metadata.getContentMetadata().getContentLength(), new Long(TEST_STRING.length())); assertEquals(metadata.getContentMetadata().getContentLength(), Long.valueOf(TEST_STRING.length()));
assertEquals(metadata.getUserMetadata().get("adrian"), "powderpuff"); assertEquals(metadata.getUserMetadata().get("adrian"), "powderpuff");
checkMD5(metadata); checkMD5(metadata);
} finally { } finally {

View File

@ -64,7 +64,7 @@ public class ListOptionsTest {
ListContainerOptions options = new ListContainerOptions(); ListContainerOptions options = new ListContainerOptions();
options.inDirectory("test").maxResults(1); options.inDirectory("test").maxResults(1);
assertEquals(options.getDir(), "test"); assertEquals(options.getDir(), "test");
assertEquals(options.getMaxResults(), new Integer(1)); assertEquals(options.getMaxResults(), Integer.valueOf(1));
} }
@ -108,7 +108,7 @@ public class ListOptionsTest {
public void testMaxResults() { public void testMaxResults() {
ListContainerOptions options = new ListContainerOptions(); ListContainerOptions options = new ListContainerOptions();
options.maxResults(1000); options.maxResults(1000);
assertEquals(options.getMaxResults(), new Integer(1000)); assertEquals(options.getMaxResults(), Integer.valueOf(1000));
} }
@Test @Test
@ -120,7 +120,7 @@ public class ListOptionsTest {
@Test @Test
public void testMaxResultsStatic() { public void testMaxResultsStatic() {
ListContainerOptions options = maxResults(1000); ListContainerOptions options = maxResults(1000);
assertEquals(options.getMaxResults(), new Integer(1000)); assertEquals(options.getMaxResults(), Integer.valueOf(1000));
} }
@Test(expectedExceptions = IllegalArgumentException.class) @Test(expectedExceptions = IllegalArgumentException.class)

View File

@ -67,7 +67,7 @@ public class ParseAzureStorageErrorFromXmlContent implements HttpErrorHandler {
if (response.getPayload() != null) { if (response.getPayload() != null) {
String contentType = response.getPayload().getContentMetadata().getContentType(); String contentType = response.getPayload().getContentMetadata().getContentType();
if (contentType != null && (contentType.indexOf("xml") != -1 || contentType.indexOf("unknown") != -1) if (contentType != null && (contentType.indexOf("xml") != -1 || contentType.indexOf("unknown") != -1)
&& !new Long(0).equals(response.getPayload().getContentMetadata().getContentLength())) { && !Long.valueOf(0).equals(response.getPayload().getContentMetadata().getContentLength())) {
try { try {
error = utils.parseAzureStorageErrorFromContent(command, response, response.getPayload().getInput()); error = utils.parseAzureStorageErrorFromContent(command, response, response.getPayload().getInput());
if (error != null) { if (error != null) {

View File

@ -94,7 +94,7 @@ public class ListOptions extends BaseHttpRequestOptions {
public Integer getMaxResults() { public Integer getMaxResults() {
String maxresults = getFirstQueryOrNull("maxresults"); String maxresults = getFirstQueryOrNull("maxresults");
return (maxresults != null) ? new Integer(maxresults) : null; return (maxresults != null) ? Integer.valueOf(maxresults) : null;
} }
public static class Builder { public static class Builder {

View File

@ -137,7 +137,7 @@ public class BindVAppConfigurationToXmlPayload implements MapBinder, Function<Ob
private void addDiskItems(XMLBuilder sectionBuilder, VApp vApp, VAppConfiguration configuration) { private void addDiskItems(XMLBuilder sectionBuilder, VApp vApp, VAppConfiguration configuration) {
for (ResourceAllocationSettingData disk : filter(vApp.getResourceAllocations(), CIMPredicates for (ResourceAllocationSettingData disk : filter(vApp.getResourceAllocations(), CIMPredicates
.resourceTypeIn(ResourceType.DISK_DRIVE))) { .resourceTypeIn(ResourceType.DISK_DRIVE))) {
if (!configuration.getDisksToDelete().contains(new Integer(disk.getAddressOnParent()))) { if (!configuration.getDisksToDelete().contains(Integer.valueOf(disk.getAddressOnParent()))) {
addDiskWithQuantity(sectionBuilder, disk); addDiskWithQuantity(sectionBuilder, disk);
} }
} }

View File

@ -91,7 +91,7 @@ public class VAppHandler extends ParseSax.HandlerWithResult<VApp> {
String statusString = attributes.get("status"); String statusString = attributes.get("status");
status = Status.fromValue(statusString); status = Status.fromValue(statusString);
if (attributes.containsKey("size")) if (attributes.containsKey("size"))
size = new Long(attributes.get("size")); size = Long.valueOf(attributes.get("size"));
} else if (qName.equals("Link")) { // type should never be missing } else if (qName.equals("Link")) { // type should never be missing
if (attributes.containsKey("type")) { if (attributes.containsKey("type")) {
if (attributes.get("type").equals(TerremarkVCloudMediaType.VDC_XML)) { if (attributes.get("type").equals(TerremarkVCloudMediaType.VDC_XML)) {

View File

@ -52,13 +52,13 @@ public class InstantiateVAppTemplateOptionsTest {
public void testCustomizeOnInstantiate() { public void testCustomizeOnInstantiate() {
InstantiateVAppTemplateOptions options = new InstantiateVAppTemplateOptions(); InstantiateVAppTemplateOptions options = new InstantiateVAppTemplateOptions();
options.customizeOnInstantiate(true); options.customizeOnInstantiate(true);
assertEquals(options.shouldCustomizeOnInstantiate(), new Boolean(true)); assertEquals(options.shouldCustomizeOnInstantiate(), Boolean.TRUE);
} }
@Test @Test
public void testCustomizeOnInstantiateStatic() { public void testCustomizeOnInstantiateStatic() {
InstantiateVAppTemplateOptions options = customizeOnInstantiate(true); InstantiateVAppTemplateOptions options = customizeOnInstantiate(true);
assertEquals(options.shouldCustomizeOnInstantiate(), new Boolean(true)); assertEquals(options.shouldCustomizeOnInstantiate(), Boolean.TRUE);
} }
@Test @Test

View File

@ -119,7 +119,7 @@ public class VAppHandlerTest extends BaseHandlerTest {
.virtualQuantity(104857l).build()); .virtualQuantity(104857l).build());
VApp expects = new VAppImpl("centos53", URI VApp expects = new VAppImpl("centos53", URI
.create("http://10.150.4.49/api/v0.8/vApp/10"), Status.ON, new Long(104857), new ReferenceTypeImpl(null, .create("http://10.150.4.49/api/v0.8/vApp/10"), Status.ON, Long.valueOf(104857), new ReferenceTypeImpl(null,
"application/vnd.vmware.vcloud.vdc+xml", URI.create("http://10.150.4.49/api/v0.8/vdc/4")), "application/vnd.vmware.vcloud.vdc+xml", URI.create("http://10.150.4.49/api/v0.8/vdc/4")),
networkToAddresses, null, "Other Linux (32-bit)", system, resourceAllocations); networkToAddresses, null, "Other Linux (32-bit)", system, resourceAllocations);
assertEquals(result.getHref(), expects.getHref()); assertEquals(result.getHref(), expects.getHref());
@ -167,7 +167,7 @@ public class VAppHandlerTest extends BaseHandlerTest {
.virtualQuantity(10485760l).build()); .virtualQuantity(10485760l).build());
VApp expects = new VAppImpl("m1", URI.create("http://localhost:8000/api/v0.8/vApp/80"), VApp expects = new VAppImpl("m1", URI.create("http://localhost:8000/api/v0.8/vApp/80"),
Status.ON, new Long(10485760), new ReferenceTypeImpl(null, "application/vnd.vmware.vcloud.vdc+xml", URI Status.ON, Long.valueOf(10485760), new ReferenceTypeImpl(null, "application/vnd.vmware.vcloud.vdc+xml", URI
.create("http://localhost:8000/api/v0.8/vdc/28")), networkToAddresses, null, .create("http://localhost:8000/api/v0.8/vdc/28")), networkToAddresses, null,
"Microsoft Windows XP Professional (32-bit)", system, resourceAllocations); "Microsoft Windows XP Professional (32-bit)", system, resourceAllocations);
assertEquals(result.getHref(), expects.getHref()); assertEquals(result.getHref(), expects.getHref());

View File

@ -345,7 +345,7 @@ public class ResourceAllocationSettingData extends ManagedElement {
}); });
public static ResourceType fromValue(String type) { public static ResourceType fromValue(String type) {
return RESOURCE_TYPE_BY_ID.get(new Integer(checkNotNull(type, "type"))); return RESOURCE_TYPE_BY_ID.get(Integer.valueOf(checkNotNull(type, "type")));
} }
} }
@ -394,7 +394,7 @@ public class ResourceAllocationSettingData extends ManagedElement {
}); });
public static ConsumerVisibility fromValue(String behavior) { public static ConsumerVisibility fromValue(String behavior) {
return MAPPING_BEHAVIOR_BY_ID.get(new Integer(checkNotNull(behavior, "behavior"))); return MAPPING_BEHAVIOR_BY_ID.get(Integer.valueOf(checkNotNull(behavior, "behavior")));
} }
} }
@ -428,7 +428,7 @@ public class ResourceAllocationSettingData extends ManagedElement {
}); });
public static MappingBehavior fromValue(String behavior) { public static MappingBehavior fromValue(String behavior) {
return MAPPING_BEHAVIOR_BY_ID.get(new Integer(checkNotNull(behavior, "behavior"))); return MAPPING_BEHAVIOR_BY_ID.get(Integer.valueOf(checkNotNull(behavior, "behavior")));
} }
} }

View File

@ -270,7 +270,7 @@ public class VirtualSystemSettingData extends ManagedElement {
}); });
public static AutomaticRecoveryAction fromValue(String automaticRecoveryAction) { public static AutomaticRecoveryAction fromValue(String automaticRecoveryAction) {
return AUTOMATIC_RECOVERY_ACTION_BY_ID.get(new Integer(checkNotNull(automaticRecoveryAction, return AUTOMATIC_RECOVERY_ACTION_BY_ID.get(Integer.valueOf(checkNotNull(automaticRecoveryAction,
"automaticRecoveryAction"))); "automaticRecoveryAction")));
} }
} }
@ -307,7 +307,7 @@ public class VirtualSystemSettingData extends ManagedElement {
}); });
public static AutomaticShutdownAction fromValue(String automaticShutdownAction) { public static AutomaticShutdownAction fromValue(String automaticShutdownAction) {
return AUTOMATIC_SHUTDOWN_ACTION_BY_ID.get(new Integer(checkNotNull(automaticShutdownAction, return AUTOMATIC_SHUTDOWN_ACTION_BY_ID.get(Integer.valueOf(checkNotNull(automaticShutdownAction,
"automaticShutdownAction"))); "automaticShutdownAction")));
} }
} }
@ -344,7 +344,7 @@ public class VirtualSystemSettingData extends ManagedElement {
}); });
public static AutomaticStartupAction fromValue(String automaticStartupAction) { public static AutomaticStartupAction fromValue(String automaticStartupAction) {
return AUTOMATIC_STARTUP_ACTION_BY_ID.get(new Integer(checkNotNull(automaticStartupAction, return AUTOMATIC_STARTUP_ACTION_BY_ID.get(Integer.valueOf(checkNotNull(automaticStartupAction,
"automaticStartupAction"))); "automaticStartupAction")));
} }
} }

View File

@ -67,13 +67,13 @@ public class ResourceAllocationSettingDataHandler extends ParseSax.HandlerWithRe
} else if (equalsOrSuffix(qName, "AllocationUnits")) { } else if (equalsOrSuffix(qName, "AllocationUnits")) {
builder.allocationUnits(current); builder.allocationUnits(current);
} else if (equalsOrSuffix(qName, "AutomaticAllocation")) { } else if (equalsOrSuffix(qName, "AutomaticAllocation")) {
builder.automaticAllocation(new Boolean(current)); builder.automaticAllocation(Boolean.valueOf(current));
} else if (equalsOrSuffix(qName, "AutomaticDeallocation")) { } else if (equalsOrSuffix(qName, "AutomaticDeallocation")) {
builder.automaticDeallocation(new Boolean(current)); builder.automaticDeallocation(Boolean.valueOf(current));
} else if (equalsOrSuffix(qName, "ConsumerVisibility")) { } else if (equalsOrSuffix(qName, "ConsumerVisibility")) {
builder.consumerVisibility(ConsumerVisibility.fromValue(current)); builder.consumerVisibility(ConsumerVisibility.fromValue(current));
} else if (equalsOrSuffix(qName, "Limit")) { } else if (equalsOrSuffix(qName, "Limit")) {
builder.limit(new Long(current)); builder.limit(Long.valueOf(current));
} else if (equalsOrSuffix(qName, "MappingBehavior")) { } else if (equalsOrSuffix(qName, "MappingBehavior")) {
builder.mappingBehavior(MappingBehavior.fromValue(current)); builder.mappingBehavior(MappingBehavior.fromValue(current));
} else if (equalsOrSuffix(qName, "OtherResourceType")) { } else if (equalsOrSuffix(qName, "OtherResourceType")) {
@ -83,17 +83,17 @@ public class ResourceAllocationSettingDataHandler extends ParseSax.HandlerWithRe
} else if (equalsOrSuffix(qName, "PoolID")) { } else if (equalsOrSuffix(qName, "PoolID")) {
builder.poolID(current); builder.poolID(current);
} else if (equalsOrSuffix(qName, "Reservation")) { } else if (equalsOrSuffix(qName, "Reservation")) {
builder.reservation(new Long(current)); builder.reservation(Long.valueOf(current));
} else if (equalsOrSuffix(qName, "ResourceSubType")) { } else if (equalsOrSuffix(qName, "ResourceSubType")) {
builder.resourceSubType(current); builder.resourceSubType(current);
} else if (equalsOrSuffix(qName, "ResourceType")) { } else if (equalsOrSuffix(qName, "ResourceType")) {
builder.resourceType(ResourceType.fromValue(current)); builder.resourceType(ResourceType.fromValue(current));
} else if (equalsOrSuffix(qName, "VirtualQuantity")) { } else if (equalsOrSuffix(qName, "VirtualQuantity")) {
builder.virtualQuantity(new Long(current)); builder.virtualQuantity(Long.valueOf(current));
} else if (equalsOrSuffix(qName, "VirtualQuantityUnits")) { } else if (equalsOrSuffix(qName, "VirtualQuantityUnits")) {
builder.virtualQuantityUnits(current); builder.virtualQuantityUnits(current);
} else if (equalsOrSuffix(qName, "Weight")) { } else if (equalsOrSuffix(qName, "Weight")) {
builder.weight(new Integer(current)); builder.weight(Integer.valueOf(current));
} else if (equalsOrSuffix(qName, "Connection")) { } else if (equalsOrSuffix(qName, "Connection")) {
builder.connection(current); builder.connection(current);
} else if (equalsOrSuffix(qName, "HostResource")) { } else if (equalsOrSuffix(qName, "HostResource")) {

View File

@ -79,7 +79,7 @@ public class VirtualSystemSettingDataHandler extends ParseSax.HandlerWithResult<
// TODO parse the format for intervals: ddddddddhhmmss.mmmmmm:000 // TODO parse the format for intervals: ddddddddhhmmss.mmmmmm:000
builder.automaticStartupActionDelay(null); builder.automaticStartupActionDelay(null);
} else if (equalsOrSuffix(qName, "AutomaticStartupActionSequenceNumber")) { } else if (equalsOrSuffix(qName, "AutomaticStartupActionSequenceNumber")) {
builder.automaticStartupActionSequenceNumber(new Integer(current)); builder.automaticStartupActionSequenceNumber(Integer.valueOf(current));
} else if (equalsOrSuffix(qName, "ConfigurationDataRoot")) { } else if (equalsOrSuffix(qName, "ConfigurationDataRoot")) {
builder.configurationDataRoot(URI.create(current)); builder.configurationDataRoot(URI.create(current));
} else if (equalsOrSuffix(qName, "ConfigurationFile")) { } else if (equalsOrSuffix(qName, "ConfigurationFile")) {

View File

@ -67,7 +67,7 @@ public class DiskSectionHandler extends SectionHandler<DiskSection, DiskSection.
Long val = null; Long val = null;
if (toParse != null) { if (toParse != null) {
try { try {
val = new Long(toParse); val = Long.valueOf(toParse);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
logger.warn("%s for disk %s not a number [%s]", key, diskId, toParse); logger.warn("%s for disk %s not a number [%s]", key, diskId, toParse);
} }

View File

@ -124,7 +124,7 @@ public class VirtualSystemSettingDataHandlerTest extends BaseHandlerTest {
@Test(enabled = false) @Test(enabled = false)
public static void checkOs(OperatingSystemSection result) { public static void checkOs(OperatingSystemSection result) {
assertEquals(result.getDescription(), "Ubuntu Linux (64-bit)"); assertEquals(result.getDescription(), "Ubuntu Linux (64-bit)");
assertEquals(result.getId(), new Integer(94)); assertEquals(result.getId(), Integer.valueOf(94));
assertEquals(result.getInfo(), "Specifies the operating system installed"); assertEquals(result.getInfo(), "Specifies the operating system installed");
} }
} }

View File

@ -634,7 +634,7 @@ public abstract class BaseComputeServiceLiveTest extends BaseComputeServiceConte
Matcher matcher = parseReported.matcher(exec.getOutput()); Matcher matcher = parseReported.matcher(exec.getOutput());
if (matcher.find()) if (matcher.find())
stats.reportedStartupTimeMilliseconds = new Long(matcher.group(1)); stats.reportedStartupTimeMilliseconds = Long.valueOf(matcher.group(1));
getAnonymousLogger().info(format("<< %s on node(%s) %s", bgProcess, node.getId(), stats)); getAnonymousLogger().info(format("<< %s on node(%s) %s", bgProcess, node.getId(), stats));
return stats; return stats;

View File

@ -94,7 +94,7 @@ public interface ContentMetadataCodec {
}); });
for (Entry<String, String> header : headers.entries()) { for (Entry<String, String> header : headers.entries()) {
if (!chunked && CONTENT_LENGTH.equalsIgnoreCase(header.getKey())) { if (!chunked && CONTENT_LENGTH.equalsIgnoreCase(header.getKey())) {
contentMetadata.setContentLength(new Long(header.getValue())); contentMetadata.setContentLength(Long.valueOf(header.getValue()));
} else if ("Content-MD5".equalsIgnoreCase(header.getKey())) { } else if ("Content-MD5".equalsIgnoreCase(header.getKey())) {
contentMetadata.setContentMD5(CryptoStreams.base64(header.getValue())); contentMetadata.setContentMD5(CryptoStreams.base64(header.getValue()));
} else if (CONTENT_TYPE.equalsIgnoreCase(header.getKey())) { } else if (CONTENT_TYPE.equalsIgnoreCase(header.getKey())) {

View File

@ -34,7 +34,7 @@ public class ByteArrayPayload extends BasePayload<byte[]> {
public ByteArrayPayload(byte[] content, byte[] md5) { public ByteArrayPayload(byte[] content, byte[] md5) {
super(content); super(content);
getContentMetadata().setContentLength(new Long(checkNotNull(content, "content").length)); getContentMetadata().setContentLength(Long.valueOf(checkNotNull(content, "content").length));
getContentMetadata().setContentMD5(md5); getContentMetadata().setContentMD5(md5);
checkArgument(content.length >= 0, "length cannot me negative"); checkArgument(content.length >= 0, "length cannot me negative");
} }

View File

@ -38,7 +38,7 @@ public class StringPayload extends BasePayload<String> {
public StringPayload(String content) { public StringPayload(String content) {
super(content); super(content);
this.bytes = content.getBytes(Charsets.UTF_8); this.bytes = content.getBytes(Charsets.UTF_8);
getContentMetadata().setContentLength(new Long(bytes.length)); getContentMetadata().setContentLength(Long.valueOf(bytes.length));
} }
/** /**

View File

@ -55,7 +55,7 @@ public class MultipartFormTest {
MultipartForm multipartForm = new MultipartForm(boundary, newPart("hello")); MultipartForm multipartForm = new MultipartForm(boundary, newPart("hello"));
assertEquals(Strings2.toString(multipartForm), expects); assertEquals(Strings2.toString(multipartForm), expects);
assertEquals(multipartForm.getContentMetadata().getContentLength(), new Long(199)); assertEquals(multipartForm.getContentMetadata().getContentLength(), Long.valueOf(199));
} }
public static class MockFilePayload extends FilePayload { public static class MockFilePayload extends FilePayload {
@ -124,7 +124,7 @@ public class MultipartFormTest {
// test repeatable // test repeatable
assert multipartForm.isRepeatable(); assert multipartForm.isRepeatable();
assertEquals(Strings2.toString(multipartForm), expects); assertEquals(Strings2.toString(multipartForm), expects);
assertEquals(multipartForm.getContentMetadata().getContentLength(), new Long(352)); assertEquals(multipartForm.getContentMetadata().getContentLength(), Long.valueOf(352));
} }
} }

View File

@ -33,7 +33,7 @@ import com.google.common.base.Charsets;
public class StringPayloadTest { public class StringPayloadTest {
public void testLengthIsCorrectPerUTF8() { public void testLengthIsCorrectPerUTF8() {
Payload stringPayload = new StringPayload("unic₪de"); Payload stringPayload = new StringPayload("unic₪de");
assertEquals(stringPayload.getContentMetadata().getContentLength(), new Long( assertEquals(stringPayload.getContentMetadata().getContentLength(), Long.valueOf(
"unic₪de".getBytes(Charsets.UTF_8).length)); "unic₪de".getBytes(Charsets.UTF_8).length));
} }
} }

View File

@ -112,7 +112,7 @@ public abstract class BaseRestApiTest {
propagate(e); propagate(e);
} }
assertEquals(payload, toMatch); assertEquals(payload, toMatch);
Long length = new Long(payload.getBytes().length); Long length = Long.valueOf(payload.getBytes().length);
try { try {
assertContentHeadersEqual(request, contentType, contentDispositon, contentEncoding, contentLanguage, assertContentHeadersEqual(request, contentType, contentDispositon, contentEncoding, contentLanguage,
length, contentMD5 ? CryptoStreams.md5(request.getPayload()) : null, expires); length, contentMD5 ? CryptoStreams.md5(request.getPayload()) : null, expires);

View File

@ -1274,7 +1274,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
.createResponseParser(parserFactory, injector, method, request); .createResponseParser(parserFactory, injector, method, request);
assertEquals(parser.apply(HttpResponse.builder().statusCode(200).message("ok") assertEquals(parser.apply(HttpResponse.builder().statusCode(200).message("ok")
.payload("{ \"destroyvirtualmachineresponse\" : {\"jobid\":4} }").build()), new Long(4)); .payload("{ \"destroyvirtualmachineresponse\" : {\"jobid\":4} }").build()), Long.valueOf(4));
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -1286,7 +1286,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest {
.createResponseParser(parserFactory, injector, method, request); .createResponseParser(parserFactory, injector, method, request);
assertEquals(parser.apply(HttpResponse.builder().statusCode(200).message("ok") assertEquals(parser.apply(HttpResponse.builder().statusCode(200).message("ok")
.payload("{ \"destroyvirtualmachineresponse\" : {\"jobid\":4} }").build()), new Long(5)); .payload("{ \"destroyvirtualmachineresponse\" : {\"jobid\":4} }").build()), Long.valueOf(5));
} }
static class TestRequestFilter1 implements HttpRequestFilter { static class TestRequestFilter1 implements HttpRequestFilter {

View File

@ -77,7 +77,7 @@ public abstract class BaseJCloudsPerformanceLiveTest extends BasePerformanceLive
S3Object object = newObject(key); S3Object object = newObject(key);
object.setPayload(data); object.setPayload(data);
try { try {
object.getPayload().getContentMetadata().setContentLength(new Long(data.available())); object.getPayload().getContentMetadata().setContentLength(Long.valueOf(data.available()));
} catch (IOException e) { } catch (IOException e) {
Throwables.propagate(e); Throwables.propagate(e);
} }

View File

@ -276,6 +276,6 @@ public class JschSshClientLiveTest {
} finally { } finally {
Closeables.closeQuietly(response); Closeables.closeQuietly(response);
} }
assertEquals(response.getExitStatus().get(), new Integer(0)); assertEquals(response.getExitStatus().get(), Integer.valueOf(0));
} }
} }

View File

@ -185,6 +185,6 @@ public class SshjSshClientLiveTest {
} finally { } finally {
Closeables.closeQuietly(response); Closeables.closeQuietly(response);
} }
assertEquals(response.getExitStatus().get(), new Integer(0)); assertEquals(response.getExitStatus().get(), Integer.valueOf(0));
} }
} }

View File

@ -53,7 +53,7 @@ public class ListContainersOptions extends BaseHttpRequestOptions {
public int getLimit() { public int getLimit() {
String val = getFirstQueryOrNull("limit"); String val = getFirstQueryOrNull("limit");
return val != null ? new Integer(val) : 10000; return val != null ? Integer.valueOf(val) : 10000;
} }
public static class Builder { public static class Builder {

View File

@ -53,7 +53,7 @@ public class ListContainersOptions extends BaseHttpRequestOptions {
public int getLimit() { public int getLimit() {
String val = getFirstQueryOrNull("limit"); String val = getFirstQueryOrNull("limit");
return val != null ? new Integer(val) : 10000; return val != null ? Integer.valueOf(val) : 10000;
} }

View File

@ -110,7 +110,7 @@ public class InstanceHandler extends ParseSax.HandlerForGeneratedRequestWithResu
} else if (equalsOrSuffix(qName, "Address")) { } else if (equalsOrSuffix(qName, "Address")) {
address = currentOrNull(currentText); address = currentOrNull(currentText);
} else if (equalsOrSuffix(qName, "Port")) { } else if (equalsOrSuffix(qName, "Port")) {
port = new Integer(currentOrNull(currentText)); port = Integer.valueOf(currentOrNull(currentText));
} else if (equalsOrSuffix(qName, "Endpoint")) { } else if (equalsOrSuffix(qName, "Endpoint")) {
builder.endpoint(HostAndPort.fromParts(address, port)); builder.endpoint(HostAndPort.fromParts(address, port));
address = null; address = null;

View File

@ -57,7 +57,7 @@ public class NetworkConfigSectionHandler extends SectionHandler<NetworkConfigSec
if (equalsOrSuffix(qName, "FenceMode")) { if (equalsOrSuffix(qName, "FenceMode")) {
builder.fenceMode(currentOrNull(currentText)); builder.fenceMode(currentOrNull(currentText));
} else if (equalsOrSuffix(qName, "Dhcp")) { } else if (equalsOrSuffix(qName, "Dhcp")) {
builder.dhcp(new Boolean(currentOrNull(currentText))); builder.dhcp(Boolean.valueOf(currentOrNull(currentText)));
} }
super.endElement(uri, localName, qName); super.endElement(uri, localName, qName);
} }

View File

@ -151,7 +151,7 @@ public class MediaApiLiveTest extends BaseVCloudDirectorApiLiveTest {
assertTrue(media.getFiles().size() == 1, String.format(OBJ_FIELD_LIST_SIZE_EQ, MEDIA, "files", 1, media.getFiles().size())); assertTrue(media.getFiles().size() == 1, String.format(OBJ_FIELD_LIST_SIZE_EQ, MEDIA, "files", 1, media.getFiles().size()));
File uploadFile = getFirst(media.getFiles(), null); File uploadFile = getFirst(media.getFiles(), null);
assertNotNull(uploadFile, String.format(OBJ_FIELD_REQ, MEDIA, "files.first")); assertNotNull(uploadFile, String.format(OBJ_FIELD_REQ, MEDIA, "files.first"));
assertEquals(uploadFile.getSize(), new Long(iso.length)); assertEquals(uploadFile.getSize(), Long.valueOf(iso.length));
assertEquals(uploadFile.getSize().longValue(), sourceMedia.getSize(), assertEquals(uploadFile.getSize().longValue(), sourceMedia.getSize(),
String.format(OBJ_FIELD_EQ, MEDIA, "uploadFile.size()", sourceMedia.getSize(), uploadFile.getSize())); String.format(OBJ_FIELD_EQ, MEDIA, "uploadFile.size()", sourceMedia.getSize(), uploadFile.getSize()));

View File

@ -115,7 +115,7 @@ public class LaunchSpecificationHandler extends HandlerForGeneratedRequestWithRe
} else if (qName.equals("enabled")) { } else if (qName.equals("enabled")) {
String monitoringEnabled = currentOrNull(); String monitoringEnabled = currentOrNull();
if (monitoringEnabled != null) if (monitoringEnabled != null)
builder.monitoringEnabled(new Boolean(monitoringEnabled)); builder.monitoringEnabled(Boolean.valueOf(monitoringEnabled));
} }
currentText = new StringBuilder(); currentText = new StringBuilder();
} }

View File

@ -190,14 +190,14 @@ public class ParallelMultipartUploadStrategy implements AsyncMultipartUploadStra
CountDownLatch latch = new CountDownLatch(effectiveParts); CountDownLatch latch = new CountDownLatch(effectiveParts);
int part; int part;
while ((part = algorithm.getNextPart()) <= parts) { while ((part = algorithm.getNextPart()) <= parts) {
Integer partKey = new Integer(part); Integer partKey = Integer.valueOf(part);
activeParts.put(partKey); activeParts.put(partKey);
prepareUploadPart(container, key, uploadId, partKey, payload, prepareUploadPart(container, key, uploadId, partKey, payload,
algorithm.getNextChunkOffset(), chunkSize, etags, algorithm.getNextChunkOffset(), chunkSize, etags,
activeParts, futureParts, errors, maxRetries, errorMap, toRetry, latch); activeParts, futureParts, errors, maxRetries, errorMap, toRetry, latch);
} }
if (remaining > 0) { if (remaining > 0) {
Integer partKey = new Integer(part); Integer partKey = Integer.valueOf(part);
activeParts.put(partKey); activeParts.put(partKey);
prepareUploadPart(container, key, uploadId, partKey, payload, prepareUploadPart(container, key, uploadId, partKey, payload,
algorithm.getNextChunkOffset(), remaining, etags, algorithm.getNextChunkOffset(), remaining, etags,
@ -210,7 +210,7 @@ public class ParallelMultipartUploadStrategy implements AsyncMultipartUploadStra
CountDownLatch retryLatch = new CountDownLatch(atOnce); CountDownLatch retryLatch = new CountDownLatch(atOnce);
for (int i = 0; i < atOnce; i++) { for (int i = 0; i < atOnce; i++) {
Part failedPart = toRetry.poll(); Part failedPart = toRetry.poll();
Integer partKey = new Integer(failedPart.getPart()); Integer partKey = Integer.valueOf(failedPart.getPart());
activeParts.put(partKey); activeParts.put(partKey);
prepareUploadPart(container, key, uploadId, partKey, payload, prepareUploadPart(container, key, uploadId, partKey, payload,
failedPart.getOffset(), failedPart.getSize(), etags, failedPart.getOffset(), failedPart.getSize(), etags,

View File

@ -75,7 +75,7 @@ public class SequentialMultipartUploadStrategy implements MultipartUploadStrateg
String eTag = null; String eTag = null;
try { try {
eTag = client.uploadPart(container, key, part, uploadId, chunkedPart); eTag = client.uploadPart(container, key, part, uploadId, chunkedPart);
etags.put(new Integer(part), eTag); etags.put(Integer.valueOf(part), eTag);
} catch (KeyNotFoundException e) { } catch (KeyNotFoundException e) {
// note that because of eventual consistency, the upload id may not be present yet // note that because of eventual consistency, the upload id may not be present yet
// we may wish to add this condition to the retry handler // we may wish to add this condition to the retry handler
@ -83,7 +83,7 @@ public class SequentialMultipartUploadStrategy implements MultipartUploadStrateg
// we may also choose to implement ListParts and wait for the uploadId to become // we may also choose to implement ListParts and wait for the uploadId to become
// available there. // available there.
eTag = client.uploadPart(container, key, part, uploadId, chunkedPart); eTag = client.uploadPart(container, key, part, uploadId, chunkedPart);
etags.put(new Integer(part), eTag); etags.put(Integer.valueOf(part), eTag);
} }
} }

View File

@ -75,14 +75,14 @@ public class SequentialMultipartUploadStrategyTest {
long chunkSize = MultipartUploadSlicingAlgorithm.DEFAULT_PART_SIZE; long chunkSize = MultipartUploadSlicingAlgorithm.DEFAULT_PART_SIZE;
long remaining = 100L; long remaining = 100L;
SortedMap<Integer, String> etags = Maps.newTreeMap(); SortedMap<Integer, String> etags = Maps.newTreeMap();
etags.put(new Integer(1), "eTag1"); etags.put(Integer.valueOf(1), "eTag1");
etags.put(new Integer(2), "eTag2"); etags.put(Integer.valueOf(2), "eTag2");
expect(blob.getMetadata()).andReturn(blobMeta).atLeastOnce(); expect(blob.getMetadata()).andReturn(blobMeta).atLeastOnce();
expect(blobMeta.getName()).andReturn(key).atLeastOnce(); expect(blobMeta.getName()).andReturn(key).atLeastOnce();
expect(blob.getPayload()).andReturn(payload).atLeastOnce(); expect(blob.getPayload()).andReturn(payload).atLeastOnce();
expect(payload.getContentMetadata()).andReturn(contentMeta).atLeastOnce(); expect(payload.getContentMetadata()).andReturn(contentMeta).atLeastOnce();
expect(contentMeta.getContentLength()).andReturn(new Long(chunkSize + remaining)); expect(contentMeta.getContentLength()).andReturn(Long.valueOf(chunkSize + remaining));
expect(ablobStore.getContext()).andReturn(context).atLeastOnce(); expect(ablobStore.getContext()).andReturn(context).atLeastOnce();
expect(context.unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN)).andReturn(psc).atLeastOnce(); expect(context.unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN)).andReturn(psc).atLeastOnce();
expect(psc.getApi()).andReturn(client).atLeastOnce(); expect(psc.getApi()).andReturn(client).atLeastOnce();
@ -138,14 +138,14 @@ public class SequentialMultipartUploadStrategyTest {
long chunkSize = MultipartUploadSlicingAlgorithm.DEFAULT_PART_SIZE; long chunkSize = MultipartUploadSlicingAlgorithm.DEFAULT_PART_SIZE;
long remaining = 100L; long remaining = 100L;
SortedMap<Integer, String> etags = Maps.newTreeMap(); SortedMap<Integer, String> etags = Maps.newTreeMap();
etags.put(new Integer(1), "eTag1"); etags.put(Integer.valueOf(1), "eTag1");
etags.put(new Integer(2), "eTag2"); etags.put(Integer.valueOf(2), "eTag2");
expect(blob.getMetadata()).andReturn(blobMeta).atLeastOnce(); expect(blob.getMetadata()).andReturn(blobMeta).atLeastOnce();
expect(blobMeta.getName()).andReturn(key).atLeastOnce(); expect(blobMeta.getName()).andReturn(key).atLeastOnce();
expect(blob.getPayload()).andReturn(payload).atLeastOnce(); expect(blob.getPayload()).andReturn(payload).atLeastOnce();
expect(payload.getContentMetadata()).andReturn(contentMeta).atLeastOnce(); expect(payload.getContentMetadata()).andReturn(contentMeta).atLeastOnce();
expect(contentMeta.getContentLength()).andReturn(new Long(chunkSize + remaining)); expect(contentMeta.getContentLength()).andReturn(Long.valueOf(chunkSize + remaining));
expect(ablobStore.getContext()).andReturn(context).atLeastOnce(); expect(ablobStore.getContext()).andReturn(context).atLeastOnce();
expect(context.unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN)).andReturn(psc).atLeastOnce(); expect(context.unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN)).andReturn(psc).atLeastOnce();
expect(psc.getApi()).andReturn(client).atLeastOnce(); expect(psc.getApi()).andReturn(client).atLeastOnce();

View File

@ -267,7 +267,7 @@ public class AzureBlobClientLiveTest extends BaseBlobStoreIntegrationTest {
AzureBlob getBlob = getApi().getBlob(privateContainer, object.getProperties().getName()); AzureBlob getBlob = getApi().getBlob(privateContainer, object.getProperties().getName());
assertEquals(Strings2.toString(getBlob.getPayload()), data); assertEquals(Strings2.toString(getBlob.getPayload()), data);
// TODO assertEquals(getBlob.getName(), object.getProperties().getName()); // TODO assertEquals(getBlob.getName(), object.getProperties().getName());
assertEquals(getBlob.getPayload().getContentMetadata().getContentLength(), new Long(data.length())); assertEquals(getBlob.getPayload().getContentMetadata().getContentLength(), Long.valueOf(data.length()));
assertEquals(getBlob.getProperties().getContentMetadata().getContentType(), "text/plain"); assertEquals(getBlob.getProperties().getContentMetadata().getContentType(), "text/plain");
assertEquals(CryptoStreams.hex(md5), assertEquals(CryptoStreams.hex(md5),
CryptoStreams.hex(getBlob.getProperties().getContentMetadata().getContentMD5())); CryptoStreams.hex(getBlob.getProperties().getContentMetadata().getContentMD5()));
@ -310,7 +310,7 @@ public class AzureBlobClientLiveTest extends BaseBlobStoreIntegrationTest {
object = getApi().newBlob(); object = getApi().newBlob();
object.getProperties().setName("chunked-object"); object.getProperties().setName("chunked-object");
object.setPayload(bais); object.setPayload(bais);
object.getPayload().getContentMetadata().setContentLength(new Long(data.getBytes().length)); object.getPayload().getContentMetadata().setContentLength(Long.valueOf(data.getBytes().length));
newEtag = getApi().putBlob(privateContainer, object); newEtag = getApi().putBlob(privateContainer, object);
assertEquals(CryptoStreams.hex(md5), assertEquals(CryptoStreams.hex(md5),
CryptoStreams.hex(getBlob.getProperties().getContentMetadata().getContentMD5())); CryptoStreams.hex(getBlob.getProperties().getContentMetadata().getContentMD5()));

View File

@ -154,19 +154,19 @@ public class GoGridComputeServiceAdapter implements ComputeServiceAdapter<Server
@Override @Override
public void destroyNode(String id) { public void destroyNode(String id) {
client.getServerServices().deleteById(new Long(id)); client.getServerServices().deleteById(Long.valueOf(id));
} }
@Override @Override
public void rebootNode(String id) { public void rebootNode(String id) {
executeCommandOnServer(PowerCommand.RESTART, id); executeCommandOnServer(PowerCommand.RESTART, id);
Server server = Iterables.getOnlyElement(client.getServerServices().getServersById(new Long(id))); Server server = Iterables.getOnlyElement(client.getServerServices().getServersById(Long.valueOf(id)));
client.getServerServices().power(server.getName(), PowerCommand.START); client.getServerServices().power(server.getName(), PowerCommand.START);
serverLatestJobCompletedShort.apply(server); serverLatestJobCompletedShort.apply(server);
} }
private boolean executeCommandOnServer(PowerCommand command, String id) { private boolean executeCommandOnServer(PowerCommand command, String id) {
Server server = Iterables.getOnlyElement(client.getServerServices().getServersById(new Long(id))); Server server = Iterables.getOnlyElement(client.getServerServices().getServersById(Long.valueOf(id)));
client.getServerServices().power(server.getName(), command); client.getServerServices().power(server.getName(), command);
return serverLatestJobCompleted.apply(server); return serverLatestJobCompleted.apply(server);
} }

View File

@ -84,12 +84,12 @@ public class GoGridComputeServiceLiveTest extends BaseComputeServiceLiveTest {
try { try {
NodeMetadata node = getOnlyElement(client.createNodesInGroup(group, 1)); NodeMetadata node = getOnlyElement(client.createNodesInGroup(group, 1));
Server updatedServer = providerContext.getApi().getServerServices().editServerRam(new Long(node.getId()), ram); Server updatedServer = providerContext.getApi().getServerServices().editServerRam(Long.valueOf(node.getId()), ram);
assertNotNull(updatedServer); assertNotNull(updatedServer);
assert serverLatestJobCompleted.apply(updatedServer); assert serverLatestJobCompleted.apply(updatedServer);
assertEquals( assertEquals(
Iterables.getLast(providerContext.getApi().getServerServices().getServersById(new Long(node.getId()))) Iterables.getLast(providerContext.getApi().getServerServices().getServersById(Long.valueOf(node.getId())))
.getRam().getName(), ram); .getRam().getName(), ram);
} finally { } finally {

View File

@ -49,8 +49,8 @@ public class ParseContainerMetadataFromHeaders implements Function<HttpResponse,
to.setReadACL(from.getFirstHeaderOrNull(SwiftHeaders.CONTAINER_READ)); to.setReadACL(from.getFirstHeaderOrNull(SwiftHeaders.CONTAINER_READ));
to.setBytes(new Long(from.getFirstHeaderOrNull(SwiftHeaders.CONTAINER_BYTES_USED))); to.setBytes(Long.valueOf(from.getFirstHeaderOrNull(SwiftHeaders.CONTAINER_BYTES_USED)));
to.setCount(new Long(from.getFirstHeaderOrNull(SwiftHeaders.CONTAINER_OBJECT_COUNT))); to.setCount(Long.valueOf(from.getFirstHeaderOrNull(SwiftHeaders.CONTAINER_OBJECT_COUNT)));
addUserMetadataTo(from, to); addUserMetadataTo(from, to);

View File

@ -234,7 +234,7 @@ public class SlicehostClientLiveTest extends BaseComputeServiceContextLiveTest {
Slice slice = client.getSlice(sliceId); Slice slice = client.getSlice(sliceId);
assertEquals(slice.getStatus(), Slice.Status.ACTIVE); assertEquals(slice.getStatus(), Slice.Status.ACTIVE);
assert slice.getProgress() >= 0 : "newDetails.getProgress()" + slice.getProgress(); assert slice.getProgress() >= 0 : "newDetails.getProgress()" + slice.getProgress();
assertEquals(new Integer(14362), slice.getImageId()); assertEquals(Integer.valueOf(14362), slice.getImageId());
assertEquals(1, slice.getFlavorId()); assertEquals(1, slice.getFlavorId());
assertNotNull(slice.getAddresses()); assertNotNull(slice.getAddresses());
checkPassOk(slice, rootPassword); checkPassOk(slice, rootPassword);

View File

@ -89,7 +89,7 @@ public class Address implements Comparable<Address> {
@Override @Override
public int compareTo(Address arg0) { public int compareTo(Address arg0) {
return new Integer(id).compareTo(arg0.getId()); return Integer.valueOf(id).compareTo(arg0.getId());
} }
/** /**

View File

@ -104,7 +104,7 @@ public class Datacenter implements Comparable<Datacenter> {
@Override @Override
public int compareTo(Datacenter arg0) { public int compareTo(Datacenter arg0) {
return new Integer(id).compareTo(arg0.getId()); return Integer.valueOf(id).compareTo(arg0.getId());
} }
/** /**

View File

@ -86,7 +86,7 @@ public class OperatingSystem implements Comparable<OperatingSystem> {
@Override @Override
public int compareTo(OperatingSystem arg0) { public int compareTo(OperatingSystem arg0) {
return new Integer(id).compareTo(arg0.getId()); return Integer.valueOf(id).compareTo(arg0.getId());
} }
/** /**

View File

@ -82,7 +82,7 @@ public class Password implements Comparable<Password> {
@Override @Override
public int compareTo(Password arg0) { public int compareTo(Password arg0) {
return new Integer(id).compareTo(arg0.getId()); return Integer.valueOf(id).compareTo(arg0.getId());
} }
/** /**

View File

@ -130,7 +130,7 @@ public class ProductItem implements Comparable<ProductItem> {
@Override @Override
public int compareTo(ProductItem arg0) { public int compareTo(ProductItem arg0) {
return new Integer(id).compareTo(arg0.getId()); return Integer.valueOf(id).compareTo(arg0.getId());
} }
/** /**

View File

@ -83,7 +83,7 @@ public class ProductItemCategory implements Comparable<ProductItemCategory> {
@Override @Override
public int compareTo(ProductItemCategory arg0) { public int compareTo(ProductItemCategory arg0) {
return new Integer(id).compareTo(arg0.getId()); return Integer.valueOf(id).compareTo(arg0.getId());
} }
/** /**

View File

@ -122,7 +122,7 @@ public class ProductItemPrice implements Comparable<ProductItemPrice> {
@Override @Override
public int compareTo(ProductItemPrice arg0) { public int compareTo(ProductItemPrice arg0) {
return new Integer(id).compareTo(arg0.getId()); return Integer.valueOf(id).compareTo(arg0.getId());
} }
/** /**

View File

@ -67,7 +67,7 @@ public class ProductOrderReceipt implements Comparable<ProductOrderReceipt> {
@Override @Override
public int compareTo(ProductOrderReceipt arg0) { public int compareTo(ProductOrderReceipt arg0) {
return new Integer(orderId).compareTo(arg0.getOrderId()); return Integer.valueOf(orderId).compareTo(arg0.getOrderId());
} }
/** /**

View File

@ -110,7 +110,7 @@ public class ProductPackage implements Comparable<ProductPackage> {
@Override @Override
public int compareTo(ProductPackage arg0) { public int compareTo(ProductPackage arg0) {
return new Integer(id).compareTo(arg0.getId()); return Integer.valueOf(id).compareTo(arg0.getId());
} }
/** /**

View File

@ -76,7 +76,7 @@ public class Region implements Comparable<Region> {
@Override @Override
public int compareTo(Region arg0) { public int compareTo(Region arg0) {
return new Integer(sortOrder).compareTo(arg0.sortOrder); return Integer.valueOf(sortOrder).compareTo(arg0.sortOrder);
} }
/** /**

View File

@ -326,7 +326,7 @@ public class VirtualGuest implements Comparable<VirtualGuest> {
@Override @Override
public int compareTo(VirtualGuest arg0) { public int compareTo(VirtualGuest arg0) {
return new Integer(id).compareTo(arg0.getId()); return Integer.valueOf(id).compareTo(arg0.getId());
} }
/** /**

View File

@ -231,12 +231,12 @@ public class ProductItemToImageTest {
@Test @Test
public void testOsBitsWithSpace() { public void testOsBitsWithSpace() {
assertEquals(osBits().apply("a (32 bit) os"),new Integer(32)); assertEquals(osBits().apply("a (32 bit) os"),Integer.valueOf(32));
} }
@Test @Test
public void testOsBitsNoSpace() { public void testOsBitsNoSpace() {
assertEquals(osBits().apply("a (64bit) os"),new Integer(64)); assertEquals(osBits().apply("a (64bit) os"),Integer.valueOf(64));
} }
@Test @Test

Some files were not shown because too many files have changed in this diff Show More