diff --git a/apis/rackspace-clouddns/src/main/java/org/jclouds/rackspace/clouddns/v1/binders/UpdateRecordsToJSON.java b/apis/rackspace-clouddns/src/main/java/org/jclouds/rackspace/clouddns/v1/binders/UpdateRecordsToJSON.java index b640b1302a..a496024fa7 100644 --- a/apis/rackspace-clouddns/src/main/java/org/jclouds/rackspace/clouddns/v1/binders/UpdateRecordsToJSON.java +++ b/apis/rackspace-clouddns/src/main/java/org/jclouds/rackspace/clouddns/v1/binders/UpdateRecordsToJSON.java @@ -66,8 +66,9 @@ public class UpdateRecordsToJSON implements Binder { static List toUpdateRecordList(Map idsToRecords) { List updateRecords = Lists.newArrayList(); - for (String recordId : idsToRecords.keySet()) { - Record record = idsToRecords.get(recordId); + for (Map.Entry entry : idsToRecords.entrySet()) { + String recordId = entry.getKey(); + Record record = entry.getValue(); UpdateRecord updateRecord = new UpdateRecord(); updateRecord.id = recordId; diff --git a/apis/s3/src/main/java/org/jclouds/s3/config/S3RestClientModule.java b/apis/s3/src/main/java/org/jclouds/s3/config/S3RestClientModule.java index 9086681534..23cf033007 100644 --- a/apis/s3/src/main/java/org/jclouds/s3/config/S3RestClientModule.java +++ b/apis/s3/src/main/java/org/jclouds/s3/config/S3RestClientModule.java @@ -121,7 +121,7 @@ public class S3RestClientModule ext try { return Optional.fromNullable(client.getBucketLocation(bucket)); } catch (ContainerNotFoundException e) { - return null; + return Optional.absent(); } } diff --git a/compute/src/main/java/org/jclouds/ovf/xml/internal/BaseVirtualSystemHandler.java b/compute/src/main/java/org/jclouds/ovf/xml/internal/BaseVirtualSystemHandler.java index 2fe9c12666..37e6030342 100644 --- a/compute/src/main/java/org/jclouds/ovf/xml/internal/BaseVirtualSystemHandler.java +++ b/compute/src/main/java/org/jclouds/ovf/xml/internal/BaseVirtualSystemHandler.java @@ -64,7 +64,7 @@ public class BaseVirtualSystemHandler, B extends @Inject(optional = true) protected void setExtensionHandlers( @Named("VirtualSystem") Map> extensionHandlers) { - extensionHandlers = ImmutableMap.> builder().putAll( + this.extensionHandlers = ImmutableMap.> builder().putAll( this.extensionHandlers).putAll(extensionHandlers).build(); } diff --git a/compute/src/main/java/org/jclouds/ssh/SshKeys.java b/compute/src/main/java/org/jclouds/ssh/SshKeys.java index 558a30132a..bcae87eb0e 100644 --- a/compute/src/main/java/org/jclouds/ssh/SshKeys.java +++ b/compute/src/main/java/org/jclouds/ssh/SshKeys.java @@ -55,6 +55,7 @@ import com.google.common.collect.ImmutableMap.Builder; import com.google.common.hash.HashCode; import com.google.common.hash.Hashing; import com.google.common.io.ByteSource; +import com.google.common.io.ByteStreams; /** * Utilities for ssh key pairs @@ -115,7 +116,7 @@ public class SshKeys { int byte4 = in.read(); int length = (byte1 << 24) + (byte2 << 16) + (byte3 << 8) + (byte4 << 0); byte[] val = new byte[length]; - in.read(val, 0, length); + ByteStreams.readFully(in, val); return val; }