Merge pull request #1344 from maginatics/findbugs

Address FindBugs complaints
This commit is contained in:
Adrian Cole 2013-02-22 12:19:09 -08:00
commit 86d5d69128
4 changed files with 9 additions and 5 deletions

View File

@ -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;

View File

@ -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<String> 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

View File

@ -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)

View File

@ -56,8 +56,8 @@ public class SupplyKeyMatchingValueOrNull<K, V> implements Supplier<K> {
Map<K, V> map = Maps.transformValues(supplier.get(), Suppliers.<V> 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;
}