diff --git a/aws/s3/core/src/test/java/org/jclouds/aws/s3/BaseS3MapIntegrationTest.java b/aws/s3/core/src/test/java/org/jclouds/aws/s3/BaseS3MapIntegrationTest.java index 2ac23a08e4..08371637e6 100644 --- a/aws/s3/core/src/test/java/org/jclouds/aws/s3/BaseS3MapIntegrationTest.java +++ b/aws/s3/core/src/test/java/org/jclouds/aws/s3/BaseS3MapIntegrationTest.java @@ -51,8 +51,13 @@ public abstract class BaseS3MapIntegrationTest extends S3IntegrationTest { protected BaseS3Map map; protected Map fiveStrings = ImmutableMap.of("one", "apple", "two", "bear", "three", "candy", "four", "dogma", "five", "emma"); - protected Map fiveBytes = ImmutableMap.of("one", "apple" - .getBytes(), "two", "bear".getBytes(), "three", "candy".getBytes(), + + // IMPORTANT: Java 5 struggles to correctly infer types in some cases which affects + // this ImmutableMap. The explicit typing works around the issue. Java 6 seems to cope. + // http://groups.google.com/group/google-collections-users/browse_thread/thread/df70c482c93a25d8 + protected Map fiveBytes = ImmutableMap.of( + "one", "apple".getBytes(), // Explicit cast necessary for Java 5 + "two", "bear".getBytes(), "three", "candy".getBytes(), "four", "dogma".getBytes(), "five", "emma".getBytes()); protected Map fiveInputs; protected Map fiveFiles;