Skip to content
Browse files

Address Xlint warnings

  • Loading branch information...
1 parent 2e1cc3c commit 371db8d18fcebb9d51f177a0a9bce1710b975634 Andrew Gaul committed Dec 16, 2012
Showing with 64 additions and 63 deletions.
  1. +1 −1 apis/atmos/src/main/java/org/jclouds/atmos/blobstore/AtmosAsyncBlobStore.java
  2. +1 −1 apis/atmos/src/main/java/org/jclouds/atmos/util/AtmosUtils.java
  3. +1 −1 apis/atmos/src/test/java/org/jclouds/atmos/blobstore/AtmosBlobRequestSignerTest.java
  4. +1 −1 apis/atmos/src/test/java/org/jclouds/atmos/xml/ErrorHandlerTest.java
  5. +1 −1 apis/atmos/src/test/java/org/jclouds/atmos/xml/ListDirectoryResponseHandlerTest.java
  6. +3 −3 apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToServerInfoTest.java
  7. +1 −1 apis/cloudstack/src/test/java/org/jclouds/cloudstack/internal/BaseCloudStackExpectTest.java
  8. +1 −1 apis/ec2/src/test/java/org/jclouds/ec2/xml/DescribeImagesResponseHandlerTest.java
  9. +1 −1 apis/ec2/src/test/java/org/jclouds/ec2/xml/DescribeInstancesResponseHandlerTest.java
  10. +3 −3 apis/elasticstack/src/test/java/org/jclouds/elasticstack/functions/MapToServerInfoTest.java
  11. +1 −1 apis/s3/src/test/java/org/jclouds/s3/xml/AccessControlListHandlerTest.java
  12. +1 −1 apis/s3/src/test/java/org/jclouds/s3/xml/CopyObjectHandlerTest.java
  13. +1 −1 apis/s3/src/test/java/org/jclouds/s3/xml/PayerHandlerTest.java
  14. +2 −2 apis/s3/src/test/java/org/jclouds/s3/xml/S3ParserTest.java
  15. +1 −1 ...java/org/jclouds/sqs/binders/BindChangeMessageVisibilityBatchRequestEntryToIndexedFormParams.java
  16. +1 −1 ...n/java/org/jclouds/sqs/binders/BindSendMessageBatchRequestEntryWithDelaysToIndexedFormParams.java
  17. +1 −1 apis/sts/src/test/java/org/jclouds/aws/xml/ErrorHandlerTest.java
  18. +1 −1 ...java/org/jclouds/openstack/swift/blobstore/strategy/internal/MultipartUploadSlicingAlgorithm.java
  19. +1 −1 apis/swift/src/main/java/org/jclouds/openstack/swift/options/CreateContainerOptions.java
  20. +1 −1 apis/vcloud/src/main/java/org/jclouds/vcloud/util/VCloudUtils.java
  21. +2 −2 apis/vcloud/src/test/java/org/jclouds/vcloud/xml/CatalogHandlerTest.java
  22. +4 −4 apis/vcloud/src/test/java/org/jclouds/vcloud/xml/OrgHandlerTest.java
  23. +2 −2 blobstore/src/test/java/org/jclouds/blobstore/TransientBlobRequestSignerTest.java
  24. +1 −1 common/azure/src/test/java/org/jclouds/azure/storage/xml/ErrorHandlerTest.java
  25. +2 −2 common/trmk/src/main/java/org/jclouds/trmk/vcloud_0_8/options/InstantiateVAppTemplateOptions.java
  26. +1 −1 common/trmk/src/main/java/org/jclouds/trmk/vcloud_0_8/util/VCloudUtils.java
  27. +1 −1 common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/xml/CatalogHandlerTest.java
  28. +1 −1 common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/xml/CatalogItemHandlerTest.java
  29. +1 −1 common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/xml/CustomizationParametersHandlerTest.java
  30. +2 −2 common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/xml/InternetServiceHandlerTest.java
  31. +1 −1 common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/xml/NodeHandlerTest.java
  32. +2 −2 common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/xml/VAppHandlerTest.java
  33. +1 −1 compute/src/main/java/org/jclouds/compute/functions/Sha512Crypt.java
  34. +1 −1 compute/src/test/java/org/jclouds/compute/internal/BaseComputeServiceLiveTest.java
  35. +1 −1 core/src/main/java/org/jclouds/http/HttpResponseException.java
  36. +1 −1 ...ain/java/org/jclouds/json/internal/DeserializationConstructorAndReflectiveTypeAdapterFactory.java
  37. +2 −2 core/src/test/java/org/jclouds/apis/BaseContextLiveTest.java
  38. +1 −1 core/src/test/java/org/jclouds/util/Throwables2Test.java
  39. +1 −1 providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/xml/AWSDescribeInstancesResponseHandlerTest.java
  40. +1 −1 ...src/main/java/org/jclouds/aws/s3/blobstore/strategy/internal/MultipartUploadSlicingAlgorithm.java
  41. +1 −1 ...src/main/java/org/jclouds/aws/s3/blobstore/strategy/internal/ParallelMultipartUploadStrategy.java
  42. +1 −1 ...c/main/java/org/jclouds/aws/s3/blobstore/strategy/internal/SequentialMultipartUploadStrategy.java
  43. +1 −1 providers/aws-s3/src/test/java/org/jclouds/aws/s3/AWSS3ClientLiveTest.java
  44. +1 −1 providers/azureblob/src/main/java/org/jclouds/azureblob/options/CreateContainerOptions.java
  45. +1 −1 providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSignerTest.java
  46. +2 −2 ...s/azureblob/src/test/java/org/jclouds/azureblob/xml/AccountNameEnumerationResultsHandlerTest.java
  47. +2 −2 ...azureblob/src/test/java/org/jclouds/azureblob/xml/ContainerNameEnumerationResultsHandlerTest.java
  48. +1 −0 scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/ShellToken.java
View
2 apis/atmos/src/main/java/org/jclouds/atmos/blobstore/AtmosAsyncBlobStore.java
@@ -222,7 +222,7 @@ protected boolean deleteAndVerifyContainerGone(final String container) {
ListenableFuture<BoundedSet<? extends DirectoryEntry>> returnVal = async.listDirectory(container, nativeOptions);
ListenableFuture<PageSet<? extends StorageMetadata>> list = transform(returnVal, container2ResourceList,
userExecutor);
- return (ListenableFuture<PageSet<? extends StorageMetadata>>) (options.isDetailed() ? transform(list,
+ return (options.isDetailed() ? transform(list,
fetchBlobMetadataProvider.get().setContainerName(container)) : list);
}
View
2 apis/atmos/src/main/java/org/jclouds/atmos/util/AtmosUtils.java
@@ -63,7 +63,7 @@
public AtmosError parseAtmosErrorFromContent(HttpCommand command, HttpResponse response, InputStream content)
throws HttpException {
- AtmosError error = (AtmosError) factory.create(errorHandlerProvider.get()).parse(content);
+ AtmosError error = factory.create(errorHandlerProvider.get()).parse(content);
if (error.getCode() == 1032) {
error.setStringSigned(signer.createStringToSign(command.getCurrentRequest()));
}
View
2 apis/atmos/src/test/java/org/jclouds/atmos/blobstore/AtmosBlobRequestSignerTest.java
@@ -103,7 +103,7 @@ public void testSignPutBlob() throws ArrayIndexOutOfBoundsException, SecurityExc
request,
"Accept: */*\nDate: Thu, 05 Jun 2008 16:38:19 GMT\nExpect: 100-continue\nx-emc-signature: 7Cbdnu+YA5rG9J/C9RlHk07mU7w=\nx-emc-uid: identity\n");
- assertContentHeadersEqual(request, "text/plain", null, null, null, (long) 2l, new byte[] { 0, 2, 4, 8 }, new Date(1000));
+ assertContentHeadersEqual(request, "text/plain", null, null, null, 2L, new byte[] { 0, 2, 4, 8 }, new Date(1000));
assertEquals(request.getFilters().size(), 0);
}
View
2 apis/atmos/src/test/java/org/jclouds/atmos/xml/ErrorHandlerTest.java
@@ -37,7 +37,7 @@
public class ErrorHandlerTest extends BaseHandlerTest {
ParseSax<AtmosError> createParser() {
- ParseSax<AtmosError> parser = (ParseSax<AtmosError>) factory.create(injector
+ ParseSax<AtmosError> parser = factory.create(injector
.getInstance(ErrorHandler.class));
return parser;
}
View
2 apis/atmos/src/test/java/org/jclouds/atmos/xml/ListDirectoryResponseHandlerTest.java
@@ -41,7 +41,7 @@
public class ListDirectoryResponseHandlerTest extends BaseHandlerTest {
ParseSax<Set<DirectoryEntry>> createParser() {
- ParseSax<Set<DirectoryEntry>> parser = (ParseSax<Set<DirectoryEntry>>) factory
+ ParseSax<Set<DirectoryEntry>> parser = factory
.create(injector.getInstance(ListDirectoryResponseHandler.class));
return parser;
}
View
6 apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToServerInfoTest.java
@@ -67,7 +67,7 @@
"tcp/23", "tcp/25", "tcp/110", "tcp/143", "tcp/43595")).build()))
.devices(
ImmutableMap.of("ide:0:0",
- new IDEDevice.Builder((int) 0, (int) 0).uuid("4af85ed3-0caa-4736-8a26-a33d7de0a122").build()
+ new IDEDevice.Builder(0, 0).uuid("4af85ed3-0caa-4736-8a26-a33d7de0a122").build()
))
.metrics(
@@ -95,7 +95,7 @@
.devices(
ImmutableMap.of(
"ide:0:0",
- new IDEDevice.Builder((int) 0, (int) 0).uuid("853bb98a-4fff-4c2f-a265-97c363f19ea5")
+ new IDEDevice.Builder(0, 0).uuid("853bb98a-4fff-4c2f-a265-97c363f19ea5")
.mediaType(MediaType.CDROM).build()))
.metrics(
new ServerMetrics.Builder().driveMetrics(ImmutableMap.of("ide:0:0", new DriveMetrics.Builder().build()))
@@ -143,7 +143,7 @@ public void testComplete() throws IOException {
"tcp/23", "tcp/25", "tcp/110", "tcp/143", "tcp/43595")).build()))
.devices(
ImmutableMap.of("ide:0:0",
- new IDEDevice.Builder((int) 0, (int) 0).uuid("403c9a86-0aab-4e47-aa95-e9768021c4c1").build()
+ new IDEDevice.Builder(0, 0).uuid("403c9a86-0aab-4e47-aa95-e9768021c4c1").build()
))
.metrics(
View
2 apis/cloudstack/src/test/java/org/jclouds/cloudstack/internal/BaseCloudStackExpectTest.java
@@ -53,7 +53,7 @@ protected ApiMetadata createApiMetadata() {
@Override
public S createClient(Function<HttpRequest, HttpResponse> fn, Module module, Properties props) {
- return (S) clientFrom(createInjector(fn, module, props).getInstance(CloudStackContext.class));
+ return clientFrom(createInjector(fn, module, props).getInstance(CloudStackContext.class));
}
protected abstract S clientFrom(CloudStackContext context);
View
2 apis/ec2/src/test/java/org/jclouds/ec2/xml/DescribeImagesResponseHandlerTest.java
@@ -124,7 +124,7 @@ protected void configure() {
}
});
- ParseSax<Set<Image>> parser = (ParseSax<Set<Image>>) injector.getInstance(ParseSax.Factory.class).create(
+ ParseSax<Set<Image>> parser = injector.getInstance(ParseSax.Factory.class).create(
injector.getInstance(DescribeImagesResponseHandler.class));
return parser;
}
View
2 apis/ec2/src/test/java/org/jclouds/ec2/xml/DescribeInstancesResponseHandlerTest.java
@@ -162,7 +162,7 @@ protected void configure() {
}
});
- ParseSax<Set<Reservation<? extends RunningInstance>>> parser = (ParseSax<Set<Reservation<? extends RunningInstance>>>) injector
+ ParseSax<Set<Reservation<? extends RunningInstance>>> parser = injector
.getInstance(ParseSax.Factory.class)
.create(injector.getInstance(DescribeInstancesResponseHandler.class));
return parser;
View
6 apis/elasticstack/src/test/java/org/jclouds/elasticstack/functions/MapToServerInfoTest.java
@@ -67,7 +67,7 @@
"tcp/23", "tcp/25", "tcp/110", "tcp/143", "tcp/43595")).build()))
.devices(
ImmutableMap.of("ide:0:0",
- new IDEDevice.Builder((int) 0, (int) 0).uuid("4af85ed3-0caa-4736-8a26-a33d7de0a122").build()
+ new IDEDevice.Builder(0, 0).uuid("4af85ed3-0caa-4736-8a26-a33d7de0a122").build()
))
.metrics(
@@ -95,7 +95,7 @@
.devices(
ImmutableMap.of(
"ide:0:0",
- new IDEDevice.Builder((int) 0, (int) 0).uuid("853bb98a-4fff-4c2f-a265-97c363f19ea5")
+ new IDEDevice.Builder(0, 0).uuid("853bb98a-4fff-4c2f-a265-97c363f19ea5")
.mediaType(MediaType.CDROM).build()))
.metrics(
new ServerMetrics.Builder().driveMetrics(ImmutableMap.of("ide:0:0", new DriveMetrics.Builder().build()))
@@ -149,7 +149,7 @@ public void testComplete() throws IOException {
"tcp/23", "tcp/25", "tcp/110", "tcp/143", "tcp/43595")).build()))
.devices(
ImmutableMap.of("ide:0:0",
- new IDEDevice.Builder((int) 0, (int) 0).uuid("403c9a86-0aab-4e47-aa95-e9768021c4c1").build()
+ new IDEDevice.Builder(0, 0).uuid("403c9a86-0aab-4e47-aa95-e9768021c4c1").build()
))
.metrics(
View
2 apis/s3/src/test/java/org/jclouds/s3/xml/AccessControlListHandlerTest.java
@@ -42,7 +42,7 @@
public static final String aclExtreme = "<AccessControlPolicy xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"><Owner><ID>1a405254c932b52e5b5caaa88186bc431a1bacb9ece631f835daddaf0c47677c</ID><DisplayName>jamesmurty</DisplayName></Owner><AccessControlList><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\"><URI>http://acs.amazonaws.com/groups/global/AuthenticatedUsers</URI></Grantee><Permission>WRITE</Permission></Grant><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\"><URI>http://acs.amazonaws.com/groups/global/AuthenticatedUsers</URI></Grantee><Permission>READ_ACP</Permission></Grant><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\"><ID>1a405254c932b52e5b5caaa88186bc431a1bacb9ece631f835daddaf0c47677c</ID><DisplayName>jamesmurty</DisplayName></Grantee><Permission>WRITE</Permission></Grant><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\"><URI>http://acs.amazonaws.com/groups/global/AuthenticatedUsers</URI></Grantee><Permission>WRITE_ACP</Permission></Grant><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\"><URI>http://acs.amazonaws.com/groups/global/AllUsers</URI></Grantee><Permission>READ</Permission></Grant><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\"><URI>http://acs.amazonaws.com/groups/global/AuthenticatedUsers</URI></Grantee><Permission>READ</Permission></Grant><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\"><URI>http://acs.amazonaws.com/groups/s3/LogDelivery</URI></Grantee><Permission>WRITE</Permission></Grant><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\"><ID>1a405254c932b52e5b5caaa88186bc431a1bacb9ece631f835daddaf0c47677c</ID><DisplayName>jamesmurty</DisplayName></Grantee><Permission>READ</Permission></Grant><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\"><ID>1a405254c932b52e5b5caaa88186bc431a1bacb9ece631f835daddaf0c47677c</ID><DisplayName>jamesmurty</DisplayName></Grantee><Permission>FULL_CONTROL</Permission></Grant></AccessControlList></AccessControlPolicy>";
ParseSax<AccessControlList> createParser() {
- ParseSax<AccessControlList> parser = (ParseSax<AccessControlList>) factory.create(injector
+ ParseSax<AccessControlList> parser = factory.create(injector
.getInstance(AccessControlListHandler.class));
return parser;
}
View
2 apis/s3/src/test/java/org/jclouds/s3/xml/CopyObjectHandlerTest.java
@@ -55,7 +55,7 @@ public void testApplyInputStream() {
.iso8601DateParse("2009-03-19T13:23:27.000Z"),
"\"92836a3ea45a6984d1b4d23a747d46bb\"");
- ObjectMetadata result = (ObjectMetadata) factory.create(
+ ObjectMetadata result = factory.create(
injector.getInstance(CopyObjectHandler.class)).parse(is);
assertEquals(result, expected);
View
2 apis/s3/src/test/java/org/jclouds/s3/xml/PayerHandlerTest.java
@@ -37,7 +37,7 @@
public class PayerHandlerTest extends BaseHandlerTest {
ParseSax<Payer> createParser() {
- ParseSax<Payer> parser = (ParseSax<Payer>) factory.create(injector
+ ParseSax<Payer> parser = factory.create(injector
.getInstance(PayerHandler.class));
return parser;
}
View
4 apis/s3/src/test/java/org/jclouds/s3/xml/S3ParserTest.java
@@ -139,15 +139,15 @@ public void testCanParseListContainerResult() throws HttpException {
}
private ListBucketResponse runParseListContainerResult() throws HttpException {
- return (ListBucketResponse) factory.create(injector.getInstance(ListBucketHandler.class)).setContext(
+ return factory.create(injector.getInstance(ListBucketHandler.class)).setContext(
HttpRequest.builder().method("GET").endpoint("http://bucket.com").build()).parse(
Strings2.toInputStream(listContainerResult));
}
public static final String successfulCopyObject200 = "<CopyObjectResult xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"><LastModified>2009-03-19T13:23:27.000Z</LastModified><ETag>\"92836a3ea45a6984d1b4d23a747d46bb\"</ETag></CopyObjectResult>";
private ObjectMetadata runParseCopyObjectResult() throws HttpException {
- return (ObjectMetadata) factory.create(injector.getInstance(CopyObjectHandler.class)).parse(
+ return factory.create(injector.getInstance(CopyObjectHandler.class)).parse(
Strings2.toInputStream(successfulCopyObject200));
}
View
2 .../jclouds/sqs/binders/BindChangeMessageVisibilityBatchRequestEntryToIndexedFormParams.java
@@ -42,7 +42,7 @@ protected BindChangeMessageVisibilityBatchRequestEntryToIndexedFormParams() {
}
public Map<String, String> idReceiptHandle(Iterable<String> input) {
- return Maps.uniqueIndex((Iterable<String>) input, new Function<String, String>() {
+ return Maps.uniqueIndex(input, new Function<String, String>() {
int index = 1;
@Override
View
2 ...rg/jclouds/sqs/binders/BindSendMessageBatchRequestEntryWithDelaysToIndexedFormParams.java
@@ -41,7 +41,7 @@ protected BindSendMessageBatchRequestEntryWithDelaysToIndexedFormParams() {
}
public Map<String, String> idMessageBody(Iterable<String> input) {
- return Maps.uniqueIndex((Iterable<String>) input, new Function<String, String>() {
+ return Maps.uniqueIndex(input, new Function<String, String>() {
int index = 1;
@Override
View
2 apis/sts/src/test/java/org/jclouds/aws/xml/ErrorHandlerTest.java
@@ -38,7 +38,7 @@
public static final String errorFromAmazonIfYouDontRemoveTransferEncodingHeader = "<Error><Code>NotImplemented</Code><Message>A header you provided implies functionality that is not implemented</Message><Header>Transfer-Encoding</Header><RequestId>7C59925D75D15561</RequestId><HostId>fbskVU51OZJg2yZS/wNIxoE2PmCf0ZqFd0iH6Vrzw0uKG3KmokswBytL/Bfp/GWb</HostId></Error>";
ParseSax<AWSError> createParser() {
- ParseSax<AWSError> parser = (ParseSax<AWSError>) factory.create(injector.getInstance(ErrorHandler.class));
+ ParseSax<AWSError> parser = factory.create(injector.getInstance(ErrorHandler.class));
return parser;
}
View
2 .../jclouds/openstack/swift/blobstore/strategy/internal/MultipartUploadSlicingAlgorithm.java
@@ -74,7 +74,7 @@ protected long calculateChunkSize(long length) {
long unitPartSize = defaultPartSize; // first try with default part size
int parts = (int)(length / unitPartSize);
long partSize = unitPartSize;
- int magnitude = (int) (parts / magnitudeBase);
+ int magnitude = parts / magnitudeBase;
if (magnitude > 0) {
partSize = magnitude * unitPartSize;
if (partSize > MultipartUpload.MAX_PART_SIZE) {
View
2 apis/swift/src/main/java/org/jclouds/openstack/swift/options/CreateContainerOptions.java
@@ -68,7 +68,7 @@ public static CreateContainerOptions withPublicAccess() {
public static CreateContainerOptions withMetadata(Map<String, String> metadata) {
CreateContainerOptions options = new CreateContainerOptions();
- return (CreateContainerOptions) options.withMetadata(metadata);
+ return options.withMetadata(metadata);
}
}
View
2 apis/vcloud/src/main/java/org/jclouds/vcloud/util/VCloudUtils.java
@@ -59,7 +59,7 @@ public VCloudError parseErrorFromContent(HttpRequest request, HttpResponse respo
String contentType = response.getPayload().getContentMetadata().getContentType();
if (contentType != null && contentType.startsWith(VCloudMediaType.ERROR_XML)) {
try {
- return (VCloudError) factory.create(errorHandlerProvider.get()).setContext(request).apply(response);
+ return factory.create(errorHandlerProvider.get()).setContext(request).apply(response);
} catch (RuntimeException e) {
logger.warn(e, "error parsing error");
}
View
4 apis/vcloud/src/test/java/org/jclouds/vcloud/xml/CatalogHandlerTest.java
@@ -55,7 +55,7 @@ public void testVCloud1_0() {
InputStream is = getClass().getResourceAsStream("/catalog-blank.xml");
injector = Guice.createInjector(new SaxParserModule());
factory = injector.getInstance(ParseSax.Factory.class);
- Catalog result = (Catalog) factory.create(injector.getInstance(CatalogHandler.class)).parse(is);
+ Catalog result = factory.create(injector.getInstance(CatalogHandler.class)).parse(is);
assertEquals(result, new CatalogImpl("Jclouds-private", "application/vnd.vmware.vcloud.catalog+xml", URI
.create("https://vcenterprise.bluelock.com/api/v1.0/catalog/921222081"), new ReferenceTypeImpl(null,
"application/vnd.vmware.vcloud.org+xml", URI
@@ -67,7 +67,7 @@ public void testTerremark() {
InputStream is = getClass().getResourceAsStream("/catalog.xml");
injector = Guice.createInjector(new SaxParserModule());
factory = injector.getInstance(ParseSax.Factory.class);
- Catalog result = (Catalog) factory.create(injector.getInstance(CatalogHandler.class)).parse(is);
+ Catalog result = factory.create(injector.getInstance(CatalogHandler.class)).parse(is);
assertEquals(result.getName(), "Miami Environment 1");
assert result.getDescription() == null;
View
8 apis/vcloud/src/test/java/org/jclouds/vcloud/xml/OrgHandlerTest.java
@@ -55,7 +55,7 @@ public void testApplyInputStream() {
Injector injector = Guice.createInjector(new SaxParserModule());
Factory factory = injector.getInstance(ParseSax.Factory.class);
- Org result = (Org) factory.create(injector.getInstance(OrgHandler.class)).parse(is);
+ Org result = factory.create(injector.getInstance(OrgHandler.class)).parse(is);
assertEquals(result.getName(), "ExampleOrg");
assertEquals(result.getFullName(), "ExampleOrg");
assertEquals(result.getDescription(), "Example Corp's Primary Organization.");
@@ -80,7 +80,7 @@ public void testTerremark() {
Injector injector = Guice.createInjector(new SaxParserModule());
Factory factory = injector.getInstance(ParseSax.Factory.class);
- Org result = (Org) factory.create(injector.getInstance(OrgHandler.class)).parse(is);
+ Org result = factory.create(injector.getInstance(OrgHandler.class)).parse(is);
assertEquals(result.getName(), "adrian@jclouds.org");
assertEquals(result.getFullName(), "adrian@jclouds.org");
assertEquals(result.getHref(), URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48"));
@@ -98,7 +98,7 @@ public void testHosting() {
InputStream is = getClass().getResourceAsStream("/org-hosting.xml");
Injector injector = Guice.createInjector(new SaxParserModule());
Factory factory = injector.getInstance(ParseSax.Factory.class);
- Org result = (Org) factory.create(injector.getInstance(OrgHandler.class)).parse(is);
+ Org result = factory.create(injector.getInstance(OrgHandler.class)).parse(is);
assertEquals(result.getName(), "Customer 188849");
assertEquals(result.getFullName(), "Customer 188849");
assertEquals(result.getHref(), URI.create("https://vcloud.safesecureweb.com/api/v0.8/org/188849"));
@@ -115,7 +115,7 @@ public void testSavvis() {
InputStream is = getClass().getResourceAsStream("/org-savvis.xml");
Injector injector = Guice.createInjector(new SaxParserModule());
Factory factory = injector.getInstance(ParseSax.Factory.class);
- Org result = (Org) factory.create(injector.getInstance(OrgHandler.class)).parse(is);
+ Org result = factory.create(injector.getInstance(OrgHandler.class)).parse(is);
assertEquals(result, new OrgImpl("607968.0", null, null, "607968.0", "Gravitant Inc", ImmutableMap
.<String, ReferenceType> of(), ImmutableMap.<String, ReferenceType> of("GravDataCenter1(Saved)",
new ReferenceTypeImpl("GravDataCenter1(Saved)", "application/vnd.vmware.vcloud.vdc+xml", URI
View
4 blobstore/src/test/java/org/jclouds/blobstore/TransientBlobRequestSignerTest.java
@@ -83,7 +83,7 @@ public void testSignPutBlob() throws ArrayIndexOutOfBoundsException, SecurityExc
assertNonPayloadHeadersEqual(
request,
"Authorization: Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==\nContent-Length: 2\nContent-MD5: AAIECA==\nContent-Type: text/plain\n");
- assertContentHeadersEqual(request, "text/plain", null, null, null, (long) 2l, new byte[] { 0, 2, 4, 8 }, null);
+ assertContentHeadersEqual(request, "text/plain", null, null, null, 2L, new byte[] { 0, 2, 4, 8 }, null);
assertEquals(request.getFilters().size(), 0);
}
@@ -101,7 +101,7 @@ public void testSignPutBlobWithGenerate() throws ArrayIndexOutOfBoundsException,
assertNonPayloadHeadersEqual(
request,
"Authorization: Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==\nContent-Length: 3\nContent-MD5: rL0Y20zC+Fzt72VPzMSk2A==\nContent-Type: text/plain\n");
- assertContentHeadersEqual(request, "text/plain", null, null, null, (long) 3l, md5, null);
+ assertContentHeadersEqual(request, "text/plain", null, null, null, 3L, md5, null);
assertEquals(request.getFilters().size(), 0);
}
View
2 common/azure/src/test/java/org/jclouds/azure/storage/xml/ErrorHandlerTest.java
@@ -37,7 +37,7 @@
public class ErrorHandlerTest extends BaseHandlerTest {
ParseSax<AzureStorageError> createParser() {
- ParseSax<AzureStorageError> parser = (ParseSax<AzureStorageError>) factory.create(injector
+ ParseSax<AzureStorageError> parser = factory.create(injector
.getInstance(ErrorHandler.class));
return parser;
}
View
4 ...rmk/src/main/java/org/jclouds/trmk/vcloud_0_8/options/InstantiateVAppTemplateOptions.java
@@ -403,7 +403,7 @@ public static InstantiateVAppTemplateOptions secondaryDNS(String secondaryDNS) {
*/
public static InstantiateVAppTemplateOptions productProperty(String key, String value) {
InstantiateVAppTemplateOptions options = new InstantiateVAppTemplateOptions();
- return (InstantiateVAppTemplateOptions) options.productProperty(key, value);
+ return options.productProperty(key, value);
}
/**
@@ -412,7 +412,7 @@ public static InstantiateVAppTemplateOptions productProperty(String key, String
*/
public static InstantiateVAppTemplateOptions productProperties(Map<String, String> properties) {
InstantiateVAppTemplateOptions options = new InstantiateVAppTemplateOptions();
- return (InstantiateVAppTemplateOptions) options.productProperties(properties);
+ return options.productProperties(properties);
}
}
View
2 common/trmk/src/main/java/org/jclouds/trmk/vcloud_0_8/util/VCloudUtils.java
@@ -56,7 +56,7 @@ public VCloudError parseErrorFromContent(HttpRequest request, HttpResponse respo
return null;
if (TerremarkVCloudMediaType.ERROR_XML.equals(response.getPayload().getContentMetadata().getContentType())) {
try {
- return (VCloudError) factory.create(errorHandlerProvider.get()).setContext(request).apply(response);
+ return factory.create(errorHandlerProvider.get()).setContext(request).apply(response);
} catch (RuntimeException e) {
logger.warn(e, "error parsing error");
}
View
2 common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/xml/CatalogHandlerTest.java
@@ -50,7 +50,7 @@ public void testTerremark() {
InputStream is = getClass().getResourceAsStream("/catalog.xml");
injector = Guice.createInjector(new SaxParserModule());
factory = injector.getInstance(ParseSax.Factory.class);
- Catalog result = (Catalog) factory.create(injector.getInstance(CatalogHandler.class)).parse(is);
+ Catalog result = factory.create(injector.getInstance(CatalogHandler.class)).parse(is);
assertEquals(result.getName(), "Miami Environment 1");
assert result.getDescription() == null;
View
2 common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/xml/CatalogItemHandlerTest.java
@@ -64,7 +64,7 @@ public void testApplyInputStream() {
InputStream is = getClass().getResourceAsStream("/catalogItem-terremark.xml");
- CatalogItem result = (CatalogItem) factory.create(
+ CatalogItem result = factory.create(
injector.getInstance(CatalogItemHandler.class)).parse(is);
assertEquals(
result,
View
2 ...rmk/src/test/java/org/jclouds/trmk/vcloud_0_8/xml/CustomizationParametersHandlerTest.java
@@ -40,7 +40,7 @@ public void test1() throws UnknownHostException {
InputStream is = getClass().getResourceAsStream(
"/CustomizationParameters.xml");
- CustomizationParameters result = (CustomizationParameters) factory
+ CustomizationParameters result = factory
.create(injector.getInstance(CustomizationParametersHandler.class))
.parse(is);
assertEquals(result, new CustomizationParameters(true, false, false));
View
4 common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/xml/InternetServiceHandlerTest.java
@@ -49,7 +49,7 @@ protected void setUpInjector() {
public void test1() throws UnknownHostException {
InputStream is = getClass().getResourceAsStream("/InternetService.xml");
- InternetService result = (InternetService) factory.create(injector.getInstance(InternetServiceHandler.class))
+ InternetService result = factory.create(injector.getInstance(InternetServiceHandler.class))
.parse(is);
assertEquals(result, new InternetService("IS_for_Jim", null, new PublicIpAddress("10.1.22.159", null), 80,
Protocol.HTTP, false, 1, "Some test service"));
@@ -58,7 +58,7 @@ public void test1() throws UnknownHostException {
public void test2() throws UnknownHostException {
InputStream is = getClass().getResourceAsStream("/InternetService2.xml");
- InternetService result = (InternetService) factory.create(injector.getInstance(InternetServiceHandler.class))
+ InternetService result = factory.create(injector.getInstance(InternetServiceHandler.class))
.parse(is);
assertEquals(result, new InternetService("IS_for_Jim2", URI
.create("https://services.vcloudexpress.terremark.com/api/v0.8/InternetServices/524"), new PublicIpAddress(
View
2 common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/xml/NodeHandlerTest.java
@@ -40,7 +40,7 @@
public void test1() throws UnknownHostException {
InputStream is = getClass().getResourceAsStream("/NodeService.xml");
- Node result = (Node) factory.create(injector.getInstance(NodeHandler.class)).parse(is);
+ Node result = factory.create(injector.getInstance(NodeHandler.class)).parse(is);
assertEquals(result, new Node("Node for Jim", URI
.create("https://services.vcloudexpress.terremark.com/api/v0.8/NodeServices/242"), "172.16.20.3", 80,
false, "Some test node"));
View
4 common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/xml/VAppHandlerTest.java
@@ -78,7 +78,7 @@ protected void configure() {
public void testApplyInputStream() {
InputStream is = getClass().getResourceAsStream("/launched_vapp.xml");
- VApp result = (VApp) factory.create(
+ VApp result = factory.create(
injector.getInstance(VAppHandler.class)).parse(is);
assertEquals(result.getName(), "adriantest");
@@ -95,7 +95,7 @@ public void testApplyInputStream() {
public void testGetVApp() throws UnknownHostException {
InputStream is = getClass().getResourceAsStream("/get_vapp.xml");
- VApp result = (VApp) factory.create(
+ VApp result = factory.create(
injector.getInstance(VAppHandler.class)).parse(is);
assertEquals(result.getName(), "centos-53");
View
2 compute/src/main/java/org/jclouds/compute/functions/Sha512Crypt.java
@@ -335,7 +335,7 @@ private static final String b64_from_24bit(byte B2, byte B1, byte B0, int size)
StringBuilder result = new StringBuilder();
while (--size >= 0) {
- result.append(itoa64.charAt((int) (v & 0x3f)));
+ result.append(itoa64.charAt(v & 0x3f));
v >>>= 6;
}
View
2 compute/src/test/java/org/jclouds/compute/internal/BaseComputeServiceLiveTest.java
@@ -567,7 +567,7 @@ public void testGetNodesWithDetails() throws Exception {
assert node.getLocation() != null : node;
assertEquals(node.getType(), ComputeType.NODE);
assert node instanceof NodeMetadata;
- NodeMetadata nodeMetadata = (NodeMetadata) node;
+ NodeMetadata nodeMetadata = node;
assert nodeMetadata.getProviderId() != null : nodeMetadata;
// nullable
// assert nodeMetadata.getImage() != null : node;
View
2 core/src/main/java/org/jclouds/http/HttpResponseException.java
@@ -77,7 +77,7 @@ public HttpResponseException(String message, HttpCommand command, @Nullable Http
public HttpResponseException(HttpCommand command, HttpResponse response) {
this(String.format("request: %s %sfailed with response: %s", command.getCurrentRequest().getRequestLine(),
- requestPayloadIfStringOrFormIfNotReturnEmptyString((HttpRequest) command.getCurrentRequest()),
+ requestPayloadIfStringOrFormIfNotReturnEmptyString(command.getCurrentRequest()),
response.getStatusLine()), command, response);
}
View
2 .../org/jclouds/json/internal/DeserializationConstructorAndReflectiveTypeAdapterFactory.java
@@ -214,7 +214,7 @@ public void write(JsonWriter out, T value) throws IOException {
private T newInstance(Object[] ctorParams) throws AssertionError {
try {
- return (T) parameterizedCtor.invoke(null, ctorParams);
+ return parameterizedCtor.invoke(null, ctorParams);
} catch (IllegalAccessException e) {
throw new AssertionError(e);
} catch (InvocationTargetException e) {
View
4 core/src/test/java/org/jclouds/apis/BaseContextLiveTest.java
@@ -108,7 +108,7 @@ protected ProviderMetadata createProviderMetadata() {
*/
protected ApiMetadata createApiMetadata() {
try {
- return (ApiMetadata) Apis.withId(provider);
+ return Apis.withId(provider);
} catch (NoSuchElementException e) {
return null;
}
@@ -123,7 +123,7 @@ protected C createContext(Properties props, Iterable<Module> modules) {
protected ContextBuilder newBuilder() {
if (provider != null)
try {
- return (ContextBuilder) ContextBuilder.newBuilder(provider);
+ return ContextBuilder.newBuilder(provider);
} catch (NoSuchElementException e){
Logger.getAnonymousLogger()
.warning("provider ["
View
2 core/src/test/java/org/jclouds/util/Throwables2Test.java
@@ -134,7 +134,7 @@ public void testGetFirstThrowableOfTypeInnerTransformParallel() {
public void testGetFirstThrowableOfTypeOuterTransformParallel() {
Exception aex = createMock(AuthorizationException.class);
TransformParallelException pex = new TransformParallelException(ImmutableMap.<Object, Future<?>> of(),
- ImmutableMap.of("bad", (Exception) aex), "test");
+ ImmutableMap.of("bad", aex), "test");
assertEquals(getFirstThrowableOfType(new ExecutionException(pex), AuthorizationException.class), aex);
}
View
2 ...ws-ec2/src/test/java/org/jclouds/aws/ec2/xml/AWSDescribeInstancesResponseHandlerTest.java
@@ -156,7 +156,7 @@ protected void configure() {
}
});
- ParseSax<Set<Reservation<? extends RunningInstance>>> parser = (ParseSax<Set<Reservation<? extends RunningInstance>>>) injector
+ ParseSax<Set<Reservation<? extends RunningInstance>>> parser = injector
.getInstance(ParseSax.Factory.class)
.create(injector.getInstance(AWSDescribeInstancesResponseHandler.class));
return parser;
View
2 .../java/org/jclouds/aws/s3/blobstore/strategy/internal/MultipartUploadSlicingAlgorithm.java
@@ -75,7 +75,7 @@ protected long calculateChunkSize(long length) {
long unitPartSize = defaultPartSize; // first try with default part size
int parts = (int)(length / unitPartSize);
long partSize = unitPartSize;
- int magnitude = (int) (parts / magnitudeBase);
+ int magnitude = parts / magnitudeBase;
if (magnitude > 0) {
partSize = magnitude * unitPartSize;
if (partSize > MultipartUpload.MAX_PART_SIZE) {
View
2 .../java/org/jclouds/aws/s3/blobstore/strategy/internal/ParallelMultipartUploadStrategy.java
@@ -166,7 +166,7 @@ public String call() throws Exception {
long chunkSize = algorithm.getChunkSize();
long remaining = algorithm.getRemaining();
if (parts > 0) {
- AWSS3Client client = (AWSS3Client) ablobstore
+ AWSS3Client client = ablobstore
.getContext().unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getApi();
String uploadId = null;
final Map<Integer, ListenableFuture<String>> futureParts =
View
2 ...ava/org/jclouds/aws/s3/blobstore/strategy/internal/SequentialMultipartUploadStrategy.java
@@ -99,7 +99,7 @@ public String execute(String container, Blob blob, PutOptions options) {
int parts = algorithm.getParts();
long chunkSize = algorithm.getChunkSize();
if (parts > 0) {
- AWSS3Client client = (AWSS3Client) ablobstore.getContext()
+ AWSS3Client client = ablobstore.getContext()
.unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getApi();
String uploadId = client.initiateMultipartUpload(container,
ObjectMetadataBuilder.create().key(key).build()); // TODO md5
View
2 providers/aws-s3/src/test/java/org/jclouds/aws/s3/AWSS3ClientLiveTest.java
@@ -83,7 +83,7 @@ public AWSS3ClientLiveTest() {
@Override
public AWSS3Client getApi() {
- return (AWSS3Client) view.unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getApi();
+ return view.unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getApi();
}
@BeforeClass(groups = { "integration", "live" })
View
2 providers/azureblob/src/main/java/org/jclouds/azureblob/options/CreateContainerOptions.java
@@ -72,7 +72,7 @@ public static CreateContainerOptions withPublicAccess(PublicAccess access) {
*/
public static CreateContainerOptions withMetadata(Multimap<String, String> metadata) {
CreateContainerOptions options = new CreateContainerOptions();
- return (CreateContainerOptions) options.withMetadata(metadata);
+ return options.withMetadata(metadata);
}
}
View
2 ...s/azureblob/src/test/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSignerTest.java
@@ -98,7 +98,7 @@ public void testSignPutBlob() throws ArrayIndexOutOfBoundsException, SecurityExc
assertNonPayloadHeadersEqual(
request,
"Authorization: SharedKeyLite identity:ssvK6ZB8GMqRcp1lBpY9vIzbLKL9Goxh7wZ2YhfHNzQ=\nDate: Thu, 05 Jun 2008 16:38:19 GMT\nExpect: 100-continue\nx-ms-blob-type: BlockBlob\nx-ms-version: 2009-09-19\n");
- assertContentHeadersEqual(request, "text/plain", null, null, null, (long) 2l, new byte[] { 0, 2, 4, 8 }, new Date(1000));
+ assertContentHeadersEqual(request, "text/plain", null, null, null, 2L, new byte[] { 0, 2, 4, 8 }, new Date(1000));
assertEquals(request.getFilters().size(), 0);
}
View
4 ...lob/src/test/java/org/jclouds/azureblob/xml/AccountNameEnumerationResultsHandlerTest.java
@@ -73,7 +73,7 @@ public void testApplyInputStream() {
BoundedSet<ContainerProperties> list = new BoundedHashSet<ContainerProperties>(contents, URI
.create("http://myaccount.blob.core.windows.net/"), null, null, 3, "video");
- BoundedSet<ContainerProperties> result = (BoundedSet<ContainerProperties>) factory.create(
+ BoundedSet<ContainerProperties> result = factory.create(
injector.getInstance(AccountNameEnumerationResultsHandler.class)).parse(is);
assertEquals(result, list);
@@ -96,7 +96,7 @@ public void testApplyInputStreamWithOptions() {
InputStream is = getClass().getResourceAsStream("/test_list_containers_options.xml");
BoundedSet<ContainerProperties> list = new BoundedHashSet<ContainerProperties>(contents, URI
.create("http://myaccount.blob.core.windows.net"), "prefix", "marker", 1, "video");
- BoundedSet<ContainerProperties> result = (BoundedSet<ContainerProperties>) factory.create(
+ BoundedSet<ContainerProperties> result = factory.create(
injector.getInstance(AccountNameEnumerationResultsHandler.class)).parse(is);
assertEquals(result, list);
}
View
4 ...b/src/test/java/org/jclouds/azureblob/xml/ContainerNameEnumerationResultsHandlerTest.java
@@ -80,7 +80,7 @@ public void testApplyInputStream() {
URI.create("http://myaccount.blob.core.windows.net/mycontainer"), "myfolder/", null, 4, "newblob2.txt",
null, ImmutableSet.<String> of("myfolder/"));
- ListBlobsResponse result = (ListBlobsResponse) factory.create(
+ ListBlobsResponse result = factory.create(
injector.getInstance(ContainerNameEnumerationResultsHandler.class)).parse(is);
assertEquals(result, list);
@@ -99,7 +99,7 @@ public void testOptions() {
null, null, 1, "2!68!MDAwMDA2IWFwcGxlcyEwMDAwMjghOTk5OS0xMi0zMVQyMzo1OTo1OS45OTk5OTk5WiE-", "/",
Sets.<String> newTreeSet());
- ListBlobsResponse result = (ListBlobsResponse) factory.create(
+ ListBlobsResponse result = factory.create(
injector.getInstance(ContainerNameEnumerationResultsHandler.class)).parse(is);
assertEquals(result, list);
View
1 scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/ShellToken.java
@@ -74,6 +74,7 @@
return familyToTokenValueMap.getUnchecked(family);
}
+ @SuppressWarnings("fallthrough")
public String to(OsFamily family) {
checkNotNull(family, "family");
switch (this) {

0 comments on commit 371db8d

Please sign in to comment.
Something went wrong with that request. Please try again.