From ec4cdfda0565259cf798354fe56a325c7ce420a6 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Tue, 22 Jan 2013 00:20:04 -0800 Subject: [PATCH] Address FindBugs complaints --- .../blobstore/domain/internal/BlobBuilderImpl.java | 2 +- .../jclouds/blobstore/reference/BlobStoreConstants.java | 8 ++++++-- .../jclouds/http/handlers/BackoffLimitedRetryHandler.java | 2 +- .../jclouds/suppliers/SupplyKeyMatchingValueOrNull.java | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/blobstore/src/main/java/org/jclouds/blobstore/domain/internal/BlobBuilderImpl.java b/blobstore/src/main/java/org/jclouds/blobstore/domain/internal/BlobBuilderImpl.java index 5635590c9f..a74f7f1a91 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/domain/internal/BlobBuilderImpl.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/domain/internal/BlobBuilderImpl.java @@ -115,7 +115,7 @@ public class BlobBuilderImpl implements BlobBuilder { return blob; } - public class PayloadBlobBuilderImpl implements PayloadBlobBuilder { + public static class PayloadBlobBuilderImpl implements PayloadBlobBuilder { private final BlobBuilder builder; private final Payload payload; diff --git a/blobstore/src/main/java/org/jclouds/blobstore/reference/BlobStoreConstants.java b/blobstore/src/main/java/org/jclouds/blobstore/reference/BlobStoreConstants.java index 5966503800..8b5c3fb955 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/reference/BlobStoreConstants.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/reference/BlobStoreConstants.java @@ -18,6 +18,10 @@ */ package org.jclouds.blobstore.reference; +import java.util.Collection; + +import com.google.common.collect.ImmutableList; + /** * Configuration properties and constants used in BlobStore connections. * @@ -38,8 +42,8 @@ public interface BlobStoreConstants { */ public static final String DIRECTORY_SUFFIX_ROOT = "/"; public static final String DIRECTORY_SUFFIX_FOLDER = "_$folder$"; - public static final String[] DIRECTORY_SUFFIXES = { DIRECTORY_SUFFIX_FOLDER, - DIRECTORY_SUFFIX_ROOT }; + public static final Collection DIRECTORY_SUFFIXES = + ImmutableList.of(DIRECTORY_SUFFIX_FOLDER, DIRECTORY_SUFFIX_ROOT); /** * Key-value implementations of BlobStore, such as S3, do not have directories. We use an empty diff --git a/core/src/main/java/org/jclouds/http/handlers/BackoffLimitedRetryHandler.java b/core/src/main/java/org/jclouds/http/handlers/BackoffLimitedRetryHandler.java index 46d1ab8dbd..b0393b6eb7 100644 --- a/core/src/main/java/org/jclouds/http/handlers/BackoffLimitedRetryHandler.java +++ b/core/src/main/java/org/jclouds/http/handlers/BackoffLimitedRetryHandler.java @@ -79,7 +79,7 @@ import com.google.inject.Inject; @Singleton public class BackoffLimitedRetryHandler implements HttpRetryHandler, IOExceptionRetryHandler { - public static BackoffLimitedRetryHandler INSTANCE = new BackoffLimitedRetryHandler(); + public static final BackoffLimitedRetryHandler INSTANCE = new BackoffLimitedRetryHandler(); @Inject(optional = true) @Named(Constants.PROPERTY_MAX_RETRIES) diff --git a/core/src/main/java/org/jclouds/suppliers/SupplyKeyMatchingValueOrNull.java b/core/src/main/java/org/jclouds/suppliers/SupplyKeyMatchingValueOrNull.java index ea7ba96201..0d1773ab2a 100644 --- a/core/src/main/java/org/jclouds/suppliers/SupplyKeyMatchingValueOrNull.java +++ b/core/src/main/java/org/jclouds/suppliers/SupplyKeyMatchingValueOrNull.java @@ -56,8 +56,8 @@ public class SupplyKeyMatchingValueOrNull implements Supplier { Map map = Maps.transformValues(supplier.get(), Suppliers. supplierFunction()); K region = ImmutableBiMap.copyOf(map).inverse().get(uri); if (region == null && map.size() > 0) { - logger.warn("failed to find key for value %s in %s; choosing first: %s", uri, map, region); region = Iterables.get(map.keySet(), 0); + logger.warn("failed to find key for value %s in %s; choosing first: %s", uri, map, region); } return region; }