Add whitespace around keywords and braces

This commit is contained in:
Andrew Gaul 2013-09-30 05:55:13 -07:00
parent 0aa19a0cee
commit f1fc63ab76
175 changed files with 260 additions and 260 deletions

View File

@ -77,7 +77,7 @@ public class AtmosUtils {
try {
sync.createFile(container, object, options);
} catch(KeyAlreadyExistsException e) {
} catch (KeyAlreadyExistsException e) {
deletePathAndEnsureGone(sync, path);
sync.createFile(container, object, options);
}

View File

@ -48,7 +48,7 @@ import com.google.inject.Module;
@Test(groups = "unit", testName = "AtmosBlobRequestSignerTest")
public class AtmosBlobRequestSignerTest extends BaseAsyncClientTest<AtmosAsyncClient> {
public AtmosBlobRequestSignerTest(){
public AtmosBlobRequestSignerTest() {
// this is base64 decoded in the signer;
credential = "aaaabbbb";
}

View File

@ -102,7 +102,7 @@ public class NodeToNodeMetadata implements Function<Node, NodeMetadata> {
} else if (from.getCredential() != null) {
credBuilder.credential(from.getCredential());
}
if (from.getSudoPassword() != null){
if (from.getSudoPassword() != null) {
credBuilder.password(from.getSudoPassword());
credBuilder.authenticateSudo(true);
}

View File

@ -69,7 +69,7 @@ public class CloudFilesApiMetadata extends SwiftApiMetadata {
public static class Builder extends SwiftApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder(){
protected Builder() {
super(CloudFilesClient.class, CloudFilesAsyncClient.class);
id("cloudfiles")
.name("Rackspace Cloud Files API")

View File

@ -41,7 +41,7 @@ import com.google.common.collect.Iterables;
@Test(groups = "live")
public class CloudFilesClientLiveTest extends CommonSwiftClientLiveTest<CloudFilesClient> {
public CloudFilesClientLiveTest(){
public CloudFilesClientLiveTest() {
provider = "cloudfiles";
}

View File

@ -31,7 +31,7 @@ import static org.testng.Assert.assertEquals;
*/
@Test(groups = "live")
public class CloudFilesBlobIntegrationLiveTest extends SwiftBlobIntegrationLiveTest {
public CloudFilesBlobIntegrationLiveTest(){
public CloudFilesBlobIntegrationLiveTest() {
provider = "cloudfiles";
}

View File

@ -24,7 +24,7 @@ import org.testng.annotations.Test;
*/
@Test(groups = "live")
public class CloudFilesContainerIntegrationLiveTest extends SwiftContainerIntegrationLiveTest {
public CloudFilesContainerIntegrationLiveTest(){
public CloudFilesContainerIntegrationLiveTest() {
provider = "cloudfiles";
}
}

View File

@ -24,7 +24,7 @@ import org.testng.annotations.Test;
*/
@Test(groups = { "live" })
public class CloudFilesContainerLiveTest extends BaseContainerLiveTest {
public CloudFilesContainerLiveTest(){
public CloudFilesContainerLiveTest() {
provider = "cloudfiles";
}
}

View File

@ -24,7 +24,7 @@ import org.testng.annotations.Test;
*/
@Test(groups = "live")
public class CloudFilesServiceIntegrationLiveTest extends SwiftServiceIntegrationLiveTest {
public CloudFilesServiceIntegrationLiveTest(){
public CloudFilesServiceIntegrationLiveTest() {
provider = "cloudfiles";
}
}

View File

@ -40,7 +40,7 @@ public class CloudServersImageToImage implements Function<org.jclouds.cloudserve
@Inject
CloudServersImageToImage(Map<ImageStatus, Image.Status> toPortableImageStatus, Function<org.jclouds.cloudservers.domain.Image, OperatingSystem> imageToOs) {
this.toPortableImageStatus=toPortableImageStatus;
this.toPortableImageStatus = toPortableImageStatus;
this.imageToOs = imageToOs;
}

View File

@ -261,7 +261,7 @@ public class CloudStackComputeServiceContextModule extends
@Provides
@Singleton
public Map<NetworkType, ? extends OptionsConverter> optionsConverters(){
public Map<NetworkType, ? extends OptionsConverter> optionsConverters() {
return ImmutableMap.of(
NetworkType.ADVANCED, new AdvancedNetworkOptionsConverter(),
NetworkType.BASIC, new BasicNetworkOptionsConverter());

View File

@ -48,7 +48,7 @@ public class AdvancedNetworkOptionsConverter implements OptionsConverter {
} else if (templateOptions.getIpsToNetworks().isEmpty()) {
checkArgument(!networks.isEmpty(), "please setup a network for zone: " + zoneId);
Network defaultNetworkInZone = Iterables.getFirst(filter(networks.values(), and(defaultNetworkInZone(zoneId), supportsStaticNAT())), null);
if(defaultNetworkInZone == null) {
if (defaultNetworkInZone == null) {
defaultNetworkInZone = Iterables.getFirst(filter(networks.values(), isIsolatedNetwork()), null);
}
if (defaultNetworkInZone == null) {

View File

@ -33,7 +33,7 @@ import com.google.common.collect.Iterables;
*/
public class ZoneAndName {
public static final Function<ZoneAndName, String> NAME_FUNCTION = new Function<ZoneAndName, String>(){
public static final Function<ZoneAndName, String> NAME_FUNCTION = new Function<ZoneAndName, String>() {
@Override
public String apply(ZoneAndName input) {
@ -42,7 +42,7 @@ public class ZoneAndName {
};
public static final Function<ZoneAndName, String> ZONE_FUNCTION = new Function<ZoneAndName, String>(){
public static final Function<ZoneAndName, String> ZONE_FUNCTION = new Function<ZoneAndName, String>() {
@Override
public String apply(ZoneAndName input) {

View File

@ -171,7 +171,7 @@ public interface GlobalOfferingApi extends OfferingApi {
*/
@Named("updateNetworkOffering")
@GET
@QueryParams(keys = "command", values ="updateNetworkOffering")
@QueryParams(keys = "command", values = "updateNetworkOffering")
@SelectJson("networkoffering")
@Consumes(MediaType.APPLICATION_JSON)
@Fallback(NullOnNotFoundOr404.class)

View File

@ -124,7 +124,7 @@ public interface LoadBalancerApi {
*/
@Named("updateLoadBalancerRule")
@GET
@QueryParams(keys = "command", values ="updateLoadBalancerRule")
@QueryParams(keys = "command", values = "updateLoadBalancerRule")
@SelectJson("loadbalancerrule")
@OnlyElement
@Consumes(MediaType.APPLICATION_JSON)

View File

@ -84,17 +84,17 @@ public class CreateVlanIPRangeOptions extends AccountInDomainOptions {
}
public CreateVlanIPRangeOptions forVirtualNetwork(boolean forVirtualNetwork) {
this.queryParameters.replaceValues("forvirtualnetwork", ImmutableSet.of(forVirtualNetwork+""));
this.queryParameters.replaceValues("forvirtualnetwork", ImmutableSet.of(forVirtualNetwork + ""));
return this;
}
public CreateVlanIPRangeOptions zoneId(String zoneId) {
this.queryParameters.replaceValues("zoneid", ImmutableSet.of(zoneId+""));
this.queryParameters.replaceValues("zoneid", ImmutableSet.of(zoneId + ""));
return this;
}
public CreateVlanIPRangeOptions vlan(long vlan) {
this.queryParameters.replaceValues("vlan", ImmutableSet.of(vlan+""));
this.queryParameters.replaceValues("vlan", ImmutableSet.of(vlan + ""));
return this;
}
@ -104,7 +104,7 @@ public class CreateVlanIPRangeOptions extends AccountInDomainOptions {
}
public CreateVlanIPRangeOptions podId(String podId) {
this.queryParameters.replaceValues("podid", ImmutableSet.of(podId+""));
this.queryParameters.replaceValues("podid", ImmutableSet.of(podId + ""));
return this;
}
@ -119,12 +119,12 @@ public class CreateVlanIPRangeOptions extends AccountInDomainOptions {
}
public CreateVlanIPRangeOptions networkId(String networkId) {
this.queryParameters.replaceValues("networkid", ImmutableSet.of(networkId+""));
this.queryParameters.replaceValues("networkid", ImmutableSet.of(networkId + ""));
return this;
}
public CreateVlanIPRangeOptions projectId(String projectId) {
this.queryParameters.replaceValues("projectid", ImmutableSet.of(projectId+""));
this.queryParameters.replaceValues("projectid", ImmutableSet.of(projectId + ""));
return this;
}
}

View File

@ -64,7 +64,7 @@ public class ListVlanIPRangesOptions extends AccountInDomainOptions {
}
public static ListVlanIPRangesOptions vlan(String vlan) {
return new ListVlanIPRangesOptions().vlan(vlan+"");
return new ListVlanIPRangesOptions().vlan(vlan + "");
}
public static ListVlanIPRangesOptions zoneId(String zoneId) {
@ -83,12 +83,12 @@ public class ListVlanIPRangesOptions extends AccountInDomainOptions {
}
public ListVlanIPRangesOptions forVirtualNetwork(boolean forVirtualNetwork) {
this.queryParameters.replaceValues("forvirtualnetwork", ImmutableSet.of(forVirtualNetwork+""));
this.queryParameters.replaceValues("forvirtualnetwork", ImmutableSet.of(forVirtualNetwork + ""));
return this;
}
public ListVlanIPRangesOptions id(String id) {
this.queryParameters.replaceValues("id", ImmutableSet.of(id+""));
this.queryParameters.replaceValues("id", ImmutableSet.of(id + ""));
return this;
}
@ -98,17 +98,17 @@ public class ListVlanIPRangesOptions extends AccountInDomainOptions {
}
public ListVlanIPRangesOptions networkId(String networkId) {
this.queryParameters.replaceValues("networkid", ImmutableSet.of(networkId+""));
this.queryParameters.replaceValues("networkid", ImmutableSet.of(networkId + ""));
return this;
}
public ListVlanIPRangesOptions podId(String podId) {
this.queryParameters.replaceValues("podid", ImmutableSet.of(podId+""));
this.queryParameters.replaceValues("podid", ImmutableSet.of(podId + ""));
return this;
}
public ListVlanIPRangesOptions projectId(String projectId) {
this.queryParameters.replaceValues("projectid", ImmutableSet.of(projectId+""));
this.queryParameters.replaceValues("projectid", ImmutableSet.of(projectId + ""));
return this;
}
@ -118,12 +118,12 @@ public class ListVlanIPRangesOptions extends AccountInDomainOptions {
}
public ListVlanIPRangesOptions vlan(long vlan) {
this.queryParameters.replaceValues("vlan", ImmutableSet.of(vlan+""));
this.queryParameters.replaceValues("vlan", ImmutableSet.of(vlan + ""));
return this;
}
public ListVlanIPRangesOptions zoneId(String zoneId) {
this.queryParameters.replaceValues("zoneid", ImmutableSet.of(zoneId+""));
this.queryParameters.replaceValues("zoneid", ImmutableSet.of(zoneId + ""));
return this;
}
}

View File

@ -60,7 +60,7 @@ public class OptionsConverterTest {
try {
converter.apply(optionsIn, EMPTY_NETWORKS_MAP, ZONE_ID, DeployVirtualMachineOptions.NONE);
} catch(IllegalArgumentException e) {
} catch (IllegalArgumentException e) {
exceptionThrown = true;
}
@ -95,7 +95,7 @@ public class OptionsConverterTest {
boolean exceptionThrown = false;
try {
converter.apply(CloudStackTemplateOptions.NONE, EMPTY_NETWORKS_MAP, ZONE_ID, DeployVirtualMachineOptions.NONE);
} catch(IllegalArgumentException e) {
} catch (IllegalArgumentException e) {
exceptionThrown = true;
}
assertTrue(exceptionThrown);
@ -111,7 +111,7 @@ public class OptionsConverterTest {
boolean exceptionThrown = false;
try {
converter.apply(CloudStackTemplateOptions.NONE, ImmutableMap.of(unsuitableNetwork.getId(), unsuitableNetwork), ZONE_ID, DeployVirtualMachineOptions.NONE);
} catch(IllegalArgumentException e) {
} catch (IllegalArgumentException e) {
exceptionThrown = true;
}
assertTrue(exceptionThrown);

View File

@ -147,7 +147,7 @@ public class FirewallApiLiveTest extends BaseCloudStackApiLiveTest {
assert rules != null;
assertTrue(rules.size() > 0);
for(FirewallRule rule : rules) {
for (FirewallRule rule : rules) {
checkFirewallRule(rule);
}
}
@ -176,7 +176,7 @@ public class FirewallApiLiveTest extends BaseCloudStackApiLiveTest {
assert rules != null;
assertTrue(rules.size() > 0);
for(FirewallRule rule : rules) {
for (FirewallRule rule : rules) {
checkEgressFirewallRule(rule);
}
}

View File

@ -45,7 +45,7 @@ public class GlobalHostApiLiveTest extends BaseCloudStackApiLiveTest {
Set<Host> hosts = globalAdminClient.getHostClient().listHosts();
assert hosts.size() > 0 : hosts;
for(Host host : hosts) {
for (Host host : hosts) {
checkHost(host);
}
}
@ -72,7 +72,7 @@ public class GlobalHostApiLiveTest extends BaseCloudStackApiLiveTest {
Set<Cluster> clusters = globalAdminClient.getHostClient().listClusters();
assert clusters.size() > 0 : clusters;
for(Cluster cluster : clusters) {
for (Cluster cluster : clusters) {
checkCluster(cluster);
}
}

View File

@ -44,7 +44,7 @@ public class GlobalStoragePoolApiLiveTest extends BaseCloudStackApiLiveTest {
Set<StoragePool> result = globalAdminClient.getStoragePoolClient().listStoragePools();
assertNotNull(result);
assertTrue(result.size() > 0);
for(StoragePool pool : result) {
for (StoragePool pool : result) {
assertNotNull(pool.getId());
assertFalse(Strings.isNullOrEmpty(pool.getName()));
assertFalse(Strings.isNullOrEmpty(pool.getPath()));

View File

@ -80,7 +80,7 @@ public class ISOApiLiveTest extends BaseCloudStackApiLiveTest {
public void testRegisterISO() throws Exception {
Optional<OSType> guestOSTypeOptional = Iterables.tryFind(client.getGuestOSApi().listOSTypes(), Predicates.notNull());
Optional<Zone> zoneOptional = Iterables.tryFind(client.getZoneApi().listZones(available(true)), Predicates.notNull());
if(guestOSTypeOptional.isPresent() && zoneOptional.isPresent()) {
if (guestOSTypeOptional.isPresent() && zoneOptional.isPresent()) {
String osTypeId = guestOSTypeOptional.get().getId();
String zoneId = zoneOptional.get().getId();
ISO iso = client.getISOApi().registerISO(isoName, "", url, zoneId, RegisterISOOptions.Builder.isPublic(true).osTypeId(osTypeId));
@ -89,7 +89,7 @@ public class ISOApiLiveTest extends BaseCloudStackApiLiveTest {
assertEquals(iso.getName(), isoName);
} else {
String skipMessage = String.format("Cannot register the iso with url: %s", url);
if(zoneOptional.isPresent())
if (zoneOptional.isPresent())
skipMessage += " without a valid zone";
else
skipMessage += " without a valid guest OS type";

View File

@ -200,14 +200,14 @@ public class VirtualMachineApiLiveTest extends BaseCloudStackApiLiveTest {
Set<Network> allSafeNetworksInZone = adminClient.getNetworkApi().listNetworks(
ListNetworksOptions.Builder.zoneId(template.getZoneId()).isSystem(false));
for(Network net : allSafeNetworksInZone) {
if(net.getName().equals(prefix + "-ip-network")) {
for (Network net : allSafeNetworksInZone) {
if (net.getName().equals(prefix + "-ip-network")) {
logger.info("Deleting VMs in network: " + net);
Set<VirtualMachine> machinesInNetwork = adminClient.getVirtualMachineApi().listVirtualMachines(
ListVirtualMachinesOptions.Builder.networkId(net.getId()));
for(VirtualMachine machine : machinesInNetwork) {
for (VirtualMachine machine : machinesInNetwork) {
if (machine.getState().equals(VirtualMachine.State.RUNNING)) {
logger.info("Deleting VM: " + machine);
destroyMachine(machine);
@ -252,7 +252,7 @@ public class VirtualMachineApiLiveTest extends BaseCloudStackApiLiveTest {
logger.info("Created VM: " + vm);
boolean hasStaticIpNic = false;
for(NIC nic : vm.getNICs()) {
for (NIC nic : vm.getNICs()) {
if (nic.getNetworkId() == network.getId()) {
hasStaticIpNic = true;
assertEquals(nic.getIPAddress(), ipAddress);

View File

@ -49,7 +49,7 @@ public class VirtualMachineRunningTest {
@DataProvider(name = "virtualMachineStates")
public Object[][] virtualMachineStates() {
return new Object[][]{
return new Object[][] {
{State.RUNNING, true},
{State.STARTING, false},
{State.STOPPING, false},

View File

@ -43,7 +43,7 @@ public class GetMetricStatisticsBinder implements org.jclouds.rest.Binder {
private final DateService dateService;
@Inject
protected GetMetricStatisticsBinder(DateService dateService){
protected GetMetricStatisticsBinder(DateService dateService) {
this.dateService = dateService;
}

View File

@ -64,7 +64,7 @@ public final class EC2ApiMetadata extends BaseHttpApiMetadata<EC2Api> {
return properties;
}
public final static class Builder extends BaseHttpApiMetadata.Builder<EC2Api, Builder> {
public static final class Builder extends BaseHttpApiMetadata.Builder<EC2Api, Builder> {
public Builder() {
id("ec2")
.name("Amazon Elastic Compute Cloud (EC2) API")

View File

@ -287,7 +287,7 @@ public class EC2ComputeService extends BaseComputeService {
}
}
protected void cleanUpIncidentalResources(final String region, final String group){
protected void cleanUpIncidentalResources(final String region, final String group) {
// For issue #445, tries to delete security groups first: ec2 throws exception if in use, but
// deleting a key pair does not.
// This is "belt-and-braces" because deleteKeyPair also does extractIdsFromInstances & usingKeyPairAndNotDead

View File

@ -68,7 +68,7 @@ public class EC2ComputeServiceContextModule extends BaseComputeServiceContextMod
super.configure();
}
protected void installDependencies(){
protected void installDependencies() {
install(new EC2ComputeServiceDependenciesModule());
}

View File

@ -78,7 +78,7 @@ public class PresentInstances implements Function<Set<RegionAndName>, Set<Runnin
}
@Override
public String toString(){
public String toString() {
return "presentInstances()";
}
}

View File

@ -189,7 +189,7 @@ public class RunningInstanceToNodeMetadata implements Function<RunningInstance,
@VisibleForTesting
String getGroupForInstance(final RunningInstance instance) {
String group = parseGroupFrom(instance, instance.getGroupNames());
if(group == null && instance.getKeyName() != null) {
if (group == null && instance.getKeyName() != null) {
// when not using a generated security group, e.g. in VPC, try from key:
group = parseGroupFrom(instance, Sets.newHashSet(instance.getKeyName()));
}

View File

@ -72,7 +72,7 @@ public class WindowsLoginCredentialsFromEncryptedData implements Function<Passwo
.password(password)
.noPrivateKey()
.build();
} catch(Exception e) {
} catch (Exception e) {
throw Throwables.propagate(e);
}
}

View File

@ -52,7 +52,7 @@ public class RegionAndIdToImage extends CacheLoader<RegionAndName, Image> {
}
@Override
public Image load(RegionAndName key) throws ExecutionException{
public Image load(RegionAndName key) throws ExecutionException {
try {
org.jclouds.ec2.domain.Image image = Iterables.getOnlyElement(sync.getAMIApi().get()
.describeImagesInRegion(key.getRegion(), imageIds(key.getName())));

View File

@ -29,7 +29,7 @@ import com.google.common.collect.Sets;
* />
* @author Adrian Cole
*/
public class AvailabilityZoneInfo implements Comparable<AvailabilityZoneInfo>{
public class AvailabilityZoneInfo implements Comparable<AvailabilityZoneInfo> {
private final String zone;
private final String state;

View File

@ -26,7 +26,7 @@ import org.jclouds.javax.annotation.Nullable;
*
* @author Lili Nadar
*/
public class BlockDeviceMapping implements Comparable<BlockDeviceMapping>{
public class BlockDeviceMapping implements Comparable<BlockDeviceMapping> {
public static Builder builder() {
return new Builder();
}

View File

@ -35,7 +35,7 @@ import com.google.common.collect.Ordering;
* />
* @author Adrian Cole
*/
public class Reservation<T extends RunningInstance> extends ForwardingSet<T> implements Comparable<Reservation<T>>{
public class Reservation<T extends RunningInstance> extends ForwardingSet<T> implements Comparable<Reservation<T>> {
public static <T extends RunningInstance> Builder<T> builder() {
return new Builder<T>();

View File

@ -34,7 +34,7 @@ public class ReservedInstancesOffering implements Comparable<ReservedInstancesOf
public ReservedInstancesOffering(String region, String availabilityZone, long duration, float fixedPrice, String instanceType,
String productDescription, String reservedInstancesOfferingId, float usagePrice) {
this.region=region;
this.region = region;
this.availabilityZone = availabilityZone;
this.duration = duration;
this.fixedPrice = fixedPrice;

View File

@ -313,7 +313,7 @@ public class EC2CreateNodesInGroupThenAddToSetTest {
RunningInstanceToNodeMetadata runningInstanceToNodeMetadata = createMock(RunningInstanceToNodeMetadata.class);
LoadingCache<RunningInstance, Optional<LoginCredentials>> instanceToCredentials = createMock(LoadingCache.class);
LoadingCache<RegionAndName, String> elasticIpCache = createMock(LoadingCache.class);
GetNodeMetadataStrategy nodeRunning = new GetNodeMetadataStrategy(){
GetNodeMetadataStrategy nodeRunning = new GetNodeMetadataStrategy() {
@Override
public NodeMetadata getNode(String input) {

View File

@ -68,7 +68,7 @@ public abstract class BaseEC2ApiTest<T> extends BaseAsyncApiTest<T> {
@Provides
@Singleton
LoadingCache<RegionAndName, Image> provide(){
LoadingCache<RegionAndName, Image> provide() {
return CacheBuilder.newBuilder().build(new CacheLoader<RegionAndName, Image>() {
@Override

View File

@ -65,7 +65,7 @@ public abstract class BaseEC2ExpectTest<T> extends BaseRestClientExpectTest<T> {
.addFormParam("Action", "DescribeRegions").build());
Builder<HttpRequest, HttpResponse> builder = ImmutableMap.<HttpRequest, HttpResponse> builder();
for (String region : ImmutableSet.of("ap-northeast-1", "ap-southeast-1", "eu-west-1", "sa-east-1", "us-east-1", "us-west-1", "us-west-2")){
for (String region : ImmutableSet.of("ap-northeast-1", "ap-southeast-1", "eu-west-1", "sa-east-1", "us-east-1", "us-west-1", "us-west-2")) {
builder.put(
formSigner.filter(HttpRequest.builder()
.method("POST")

View File

@ -65,7 +65,7 @@ public class VolumeDetachedTest {
@DataProvider(name = "notDetachedStatuses")
public Object[][] provideNotDetachedStatuses() {
return new Object[][]{
return new Object[][] {
{Status.ATTACHED},
{Status.ATTACHING},
{Status.BUSY},

View File

@ -47,17 +47,17 @@ public class FilesystemBlobKeyValidatorTest {
try {
validator.validate("");
fail("Blob key value incorrect, but was not recognized");
} catch(IllegalArgumentException e) {}
} catch (IllegalArgumentException e) {}
try {
validator.validate(File.separator + "is" + File.separator + "" + "ok");
fail("Blob key value incorrect, but was not recognized");
} catch(IllegalArgumentException e) {}
} catch (IllegalArgumentException e) {}
try {
validator.validate("all" + File.separator + "is" + File.separator);
fail("Blob key value incorrect, but was not recognized");
} catch(IllegalArgumentException e) {}
} catch (IllegalArgumentException e) {}
}

View File

@ -47,22 +47,22 @@ public class FilesystemContainerNameValidatorTest {
try {
validator.validate("");
fail("Container name value incorrect, but was not recognized");
} catch(IllegalArgumentException e) {}
} catch (IllegalArgumentException e) {}
try {
validator.validate(null);
fail("Container name value incorrect, but was not recognized");
} catch(IllegalArgumentException e) {}
} catch (IllegalArgumentException e) {}
try {
validator.validate(File.separator + "is" + File.separator + "" + "ok");
fail("Container name value incorrect, but was not recognized");
} catch(IllegalArgumentException e) {}
} catch (IllegalArgumentException e) {}
try {
validator.validate("all" + File.separator + "is" + File.separator);
fail("Container name value incorrect, but was not recognized");
} catch(IllegalArgumentException e) {}
} catch (IllegalArgumentException e) {}
}

View File

@ -43,7 +43,7 @@ import com.google.common.collect.ImmutableSet;
@Test(testName = "TenantApiExpectTest")
public class TenantApiExpectTest extends BaseKeystoneRestApiExpectTest<KeystoneApi> {
public TenantApiExpectTest(){
public TenantApiExpectTest() {
endpoint = "https://csnode.jclouds.org:35357";
}

View File

@ -50,7 +50,7 @@ import com.google.common.collect.ImmutableSet;
@Test(testName = "TokenApiExpectTest")
public class TokenApiExpectTest extends BaseKeystoneRestApiExpectTest<KeystoneApi> {
public TokenApiExpectTest(){
public TokenApiExpectTest() {
endpoint = "https://csnode.jclouds.org:35357";
}

View File

@ -46,7 +46,7 @@ import com.google.common.collect.ImmutableSet;
@Test(singleThreaded = true, testName = "UserApiExpectTest")
public class UserApiExpectTest extends BaseKeystoneRestApiExpectTest<KeystoneApi> {
public UserApiExpectTest(){
public UserApiExpectTest() {
endpoint = "https://csnode.jclouds.org:35357";
}

View File

@ -36,15 +36,15 @@ import com.google.common.net.HttpHeaders;
public enum KeystoneFixture {
INSTANCE;
public String getTenantId(){
public String getTenantId() {
return "12346637803162";
}
public String getTenantName(){
public String getTenantName() {
return "adrian@jclouds.org";
}
public HttpRequest initialAuthWithUsernameAndPassword(String username, String password){
public HttpRequest initialAuthWithUsernameAndPassword(String username, String password) {
return HttpRequest.builder().method("POST")
.endpoint("http://localhost:5000/v2.0/tokens")
.addHeader(HttpHeaders.ACCEPT, "application/json")
@ -55,7 +55,7 @@ public enum KeystoneFixture {
username, password), "application/json")).build();
}
public HttpRequest initialAuthWithUsernameAndPasswordAndTenantName(String username, String password){
public HttpRequest initialAuthWithUsernameAndPasswordAndTenantName(String username, String password) {
return HttpRequest.builder().method("POST")
.endpoint("http://localhost:5000/v2.0/tokens")
.addHeader(HttpHeaders.ACCEPT, "application/json")
@ -66,7 +66,7 @@ public enum KeystoneFixture {
username, password, getTenantName()), "application/json")).build();
}
public HttpRequest initialAuthWithAccessKeyAndSecretKeyAndTenantName(String accessKey, String secretKey){
public HttpRequest initialAuthWithAccessKeyAndSecretKeyAndTenantName(String accessKey, String secretKey) {
return HttpRequest.builder().method("POST")
.endpoint("http://localhost:5000/v2.0/tokens")
.addHeader(HttpHeaders.ACCEPT, "application/json")
@ -77,7 +77,7 @@ public enum KeystoneFixture {
accessKey, secretKey, getTenantName()), "application/json")).build();
}
public HttpRequest initialAuthWithAccessKeyAndSecretKeyAndTenantId(String accessKey, String secretKey){
public HttpRequest initialAuthWithAccessKeyAndSecretKeyAndTenantId(String accessKey, String secretKey) {
return HttpRequest.builder().method("POST")
.endpoint("http://localhost:5000/v2.0/tokens")
@ -89,11 +89,11 @@ public enum KeystoneFixture {
accessKey, secretKey, getTenantId()), "application/json")).build();
}
public String getAuthToken(){
public String getAuthToken() {
return "Auth_4f173437e4b013bee56d1007";
}
public HttpResponse responseWithAccess(){
public HttpResponse responseWithAccess() {
return HttpResponse.builder().statusCode(200).message("HTTP/1.1 200").payload(
payloadFromResourceWithContentType("/keystoneAuthResponse.json", "application/json")).build();
}

View File

@ -53,7 +53,7 @@ public class LocationIdToURIFromAccessForTypeAndVersionTest {
@Override
protected void configure() {
bindConstant().annotatedWith(Provider.class).to("openstack-keystone");
bind(new TypeLiteral<Supplier<URI>>(){
bind(new TypeLiteral<Supplier<URI>>() {
}).annotatedWith(Provider.class).toInstance(Suppliers.ofInstance(URI.create("https://identity")));
bind(new TypeLiteral<Function<Endpoint, String>>(){}).to(EndpointToRegion.class);
install(new FactoryModuleBuilder().implement(LocationIdToURIFromAccessForTypeAndVersion.class,

View File

@ -50,7 +50,7 @@ public class RegionIdToURIFromAccessForTypeAndVersionTest {
@Override
protected void configure() {
bindConstant().annotatedWith(Provider.class).to("openstack-keystone");
bind(new TypeLiteral<Supplier<URI>>(){
bind(new TypeLiteral<Supplier<URI>>() {
}).annotatedWith(Provider.class).toInstance(Suppliers.ofInstance(URI.create("https://identity")));
install(new FactoryModuleBuilder().implement(RegionIdToURISupplier.class,
RegionIdToURIFromAccessForTypeAndVersion.class).build(

View File

@ -69,7 +69,7 @@ public final class NovaEC2ApiMetadata extends BaseHttpApiMetadata<NovaEC2Api> {
return properties;
}
public final static class Builder extends BaseHttpApiMetadata.Builder<NovaEC2Api, Builder> {
public static final class Builder extends BaseHttpApiMetadata.Builder<NovaEC2Api, Builder> {
public Builder() {
id("openstack-nova-ec2")
.name("OpenStack Nova's EC2-clone API")

View File

@ -33,7 +33,7 @@ import com.google.common.collect.Iterables;
*/
public class ZoneAndName {
public static final Function<ZoneAndName, String> NAME_FUNCTION = new Function<ZoneAndName, String>(){
public static final Function<ZoneAndName, String> NAME_FUNCTION = new Function<ZoneAndName, String>() {
@Override
public String apply(ZoneAndName input) {
@ -42,7 +42,7 @@ public class ZoneAndName {
};
public static final Function<ZoneAndName, String> ZONE_FUNCTION = new Function<ZoneAndName, String>(){
public static final Function<ZoneAndName, String> ZONE_FUNCTION = new Function<ZoneAndName, String>() {
@Override
public String apply(ZoneAndName input) {

View File

@ -89,7 +89,7 @@ public class ImageInZoneToImageTest {
}
@SuppressWarnings("unchecked")
private static Function<Image, OperatingSystem> constant(OperatingSystem operatingSystem){
private static Function<Image, OperatingSystem> constant(OperatingSystem operatingSystem) {
return Function.class.cast(Functions.constant(operatingSystem));
}
}

View File

@ -63,7 +63,7 @@ public class FindSecurityGroupOrCreateTest {
public void testWhenFoundReturnsSecurityGroupFromAtomicReferenceValueUpdatedDuringPredicateCheck() throws Exception {
final SecurityGroupInZone securityGroupInZone = createMock(SecurityGroupInZone.class);
Predicate<AtomicReference<ZoneAndName>> returnSecurityGroupExistsInZone = new Predicate<AtomicReference<ZoneAndName>>(){
Predicate<AtomicReference<ZoneAndName>> returnSecurityGroupExistsInZone = new Predicate<AtomicReference<ZoneAndName>>() {
@Override
public boolean apply(AtomicReference<ZoneAndName> input) {

View File

@ -61,7 +61,7 @@ public class FlavorExtraSpecsApiLiveTest extends BaseNovaApiLiveTest {
@Override
protected void tearDown() {
if (apiOption.isPresent() && testFlavor != null) {
for(String key : testSpecs.keySet()) {
for (String key : testSpecs.keySet()) {
assertTrue(apiOption.get().deleteMetadataKey(testFlavor.getId(), key));
}
}

View File

@ -69,7 +69,7 @@ public class CreateSecurityGroupIfNeededTest extends BaseNovaApiExpectTest {
int ruleId = 10331;
for (int port : ImmutableList.of(22,8080)){
for (int port : ImmutableList.of(22,8080)) {
HttpRequest createCidrRule = HttpRequest.builder().method("POST").endpoint(
URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-security-group-rules")).headers(

View File

@ -49,7 +49,7 @@ public class NovaErrorHandlerTest {
private HttpCommand command;
@BeforeTest
void setupCommand(){
void setupCommand() {
command = command();
}
@ -206,7 +206,7 @@ public class NovaErrorHandlerTest {
DateCodec iso8601Seconds = new DateServiceIso8601SecondsCodec(new SimpleDateFormatDateService());
Ticker y2k = new Ticker(){
Ticker y2k = new Ticker() {
@Override
public long read() {

View File

@ -59,9 +59,9 @@ public class BaseNovaApiLiveTest extends BaseApiLiveTest<NovaApi> {
public void setup() {
super.setup();
zones = api.getConfiguredZones();
for (String zone : zones){
for (String zone : zones) {
ServerApi serverApi = api.getServerApiForZone(zone);
for (Resource server : serverApi.list().concat()){
for (Resource server : serverApi.list().concat()) {
if (server.getName().equals(hostName))
serverApi.delete(server.getId());
}

View File

@ -75,7 +75,7 @@ public class CloudIdentityApiMetadata extends KeystoneApiMetadata {
public static class Builder extends KeystoneApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder(){
protected Builder() {
super(KeystoneApi.class, KeystoneAsyncApi.class);
id("rackspace-cloudidentity")
.name("Rackspace Cloud Identity Service")

View File

@ -77,9 +77,9 @@ public class ParseNodes extends ParseJson<Nodes> {
public ToPagedIterable setContext(HttpRequest request) {
String path = request.getEndpoint().getPath();
int lastSlash = path.lastIndexOf('/');
int secondLastSlash = path.lastIndexOf('/', lastSlash-1);
int secondLastSlash = path.lastIndexOf('/', lastSlash - 1);
lbId = Integer.valueOf(path.substring(secondLastSlash+1, lastSlash));
lbId = Integer.valueOf(path.substring(secondLastSlash + 1, lastSlash));
return super.setContext(request);
}

View File

@ -98,7 +98,7 @@ public class S3ApiMetadata extends BaseRestApiMetadata {
this(S3Client.class, S3AsyncClient.class);
}
protected Builder(Class<?> syncClient, Class<?> asyncClient){
protected Builder(Class<?> syncClient, Class<?> asyncClient) {
super(syncClient, asyncClient);
id("s3")
.name("Amazon Simple Storage Service (S3) API")

View File

@ -233,7 +233,7 @@ public class RequestAuthorizeSignature implements HttpRequestFilter, RequestSign
// the only S3 implementation configured to allow uppercase payload/bucket/container names.
//
// http://code.google.com/p/jclouds/issues/detail?id=992
if (isVhostStyle && bucketName!= null && bucketName.equals(bucketName.toLowerCase()))
if (isVhostStyle && bucketName != null && bucketName.equals(bucketName.toLowerCase()))
toSign.append(servicePath).append(bucketName);
}

View File

@ -53,14 +53,14 @@ public abstract class AWSHttpApiModule<A> extends HttpApiModule<A> {
@Provides
@ClientError
@Singleton
protected Set<String> provideRetryableCodes(){
protected Set<String> provideRetryableCodes() {
return ImmutableSet.of("RequestTimeout", "OperationAborted", "SignatureDoesNotMatch");
}
@Provides
@ServerError
@Singleton
protected Set<String> provideRetryableServerCodes(){
protected Set<String> provideRetryableServerCodes() {
return ImmutableSet.of("RequestLimitExceeded");
}

View File

@ -68,14 +68,14 @@ public abstract class AWSRestClientModule<S, A> extends RestClientModule<S, A> {
@Provides
@ClientError
@Singleton
protected Set<String> provideRetryableCodes(){
protected Set<String> provideRetryableCodes() {
return ImmutableSet.of("RequestTimeout", "OperationAborted", "SignatureDoesNotMatch");
}
@Provides
@ServerError
@Singleton
protected Set<String> provideRetryableServerCodes(){
protected Set<String> provideRetryableServerCodes() {
return ImmutableSet.of("RequestLimitExceeded");
}

View File

@ -267,7 +267,7 @@ public interface CommonSwiftAsyncClient extends Closeable {
@PUT
@Path("/{container}/{name}")
@ResponseParser(ParseETagHeader.class)
@Headers(keys = "X-Object-Manifest", values="{container}/{name}/")
@Headers(keys = "X-Object-Manifest", values = "{container}/{name}/")
ListenableFuture<String> putObjectManifest(@PathParam("container") String container,
@PathParam("name") String name);
}

View File

@ -82,7 +82,7 @@ public class SwiftApiMetadata extends BaseRestApiMetadata {
this(SwiftClient.class, SwiftAsyncClient.class);
}
protected Builder(Class<?> syncClient, Class<?> asyncClient){
protected Builder(Class<?> syncClient, Class<?> asyncClient) {
super(syncClient, asyncClient);
id("swift")
.name("OpenStack Swift with SwiftAuth")

View File

@ -66,7 +66,7 @@ public class ParseSwiftErrorFromHttpResponse implements HttpErrorHandler {
if (sourcePath != null) {
String path = command.getCurrentRequest().getEndpoint().getPath();
int startOfDestinationPath = path.lastIndexOf("/", path.lastIndexOf("/")-1);
int startOfDestinationPath = path.lastIndexOf("/", path.lastIndexOf("/") - 1);
String destinationPath = path.substring(startOfDestinationPath);
exception = new CopyObjectException(sourcePath, destinationPath, message);

View File

@ -25,7 +25,7 @@ import org.testng.annotations.Test;
@Test(groups = "live", testName = "SwiftClientLiveTest")
public class SwiftClientLiveTest extends CommonSwiftClientLiveTest<CommonSwiftClient> {
public SwiftClientLiveTest(){
public SwiftClientLiveTest() {
provider = System.getProperty("test.swift.provider", "swift");
}

View File

@ -25,7 +25,7 @@ import org.testng.annotations.Test;
@Test(groups = "live", testName = "SwiftKeystoneClientLiveTest")
public class SwiftKeystoneClientLiveTest extends CommonSwiftClientLiveTest<CommonSwiftClient> {
public SwiftKeystoneClientLiveTest(){
public SwiftKeystoneClientLiveTest() {
provider = System.getProperty("test.swift.provider", "swift-keystone");
}

View File

@ -101,7 +101,7 @@ public class InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployA
private DnsNameValidator validator;
ComputerNameValidator(){
ComputerNameValidator() {
this.validator = new DnsNameValidator(3, 15);
}

View File

@ -105,13 +105,13 @@ public class VCloudComputeServiceAdapter implements ComputeServiceAdapter<VApp,
public boolean apply(VAppTemplate from) {
try {
templateToEnvelope.apply(from);
} catch (IllegalArgumentException e){
logger.warn("Unsupported: "+ e.getMessage());
} catch (IllegalArgumentException e) {
logger.warn("Unsupported: " + e.getMessage());
return false;
} catch (RuntimeException e) {
IllegalArgumentException e2 = Throwables2.getFirstThrowableOfType(e, IllegalArgumentException.class);
if (e2 != null) {
logger.warn("Unsupported: "+ e2.getMessage());
logger.warn("Unsupported: " + e2.getMessage());
return false;
} else {
throw e;

View File

@ -159,9 +159,9 @@ public class IpScope {
public String toString() {
ToStringHelper helper = Objects.toStringHelper("").omitNullValues().add("inherited", inherited).add("gateway", gateway)
.add("netmask", netmask).add("dns1", dns1).add("dns2", dns2).add("dnsSuffix", dnsSuffix);
if (ipRanges.size() >0)
if (ipRanges.size() > 0)
helper.add("ipRanges", ipRanges);
if (allocatedIpAddresses.size() >0)
if (allocatedIpAddresses.size() > 0)
helper.add("allocatedIpAddresses", allocatedIpAddresses);
return helper.toString();
}

View File

@ -108,7 +108,7 @@ public class NatService {
public String toString() {
ToStringHelper helper = Objects.toStringHelper("").omitNullValues().add("enabled", enabled)
.add("type", type).add("policy", policy);
if (natRules.size() >0)
if (natRules.size() > 0)
helper.add("natRules", natRules);
return helper.toString();
}

View File

@ -52,7 +52,7 @@ public class VAppTemplatesInOrg implements Function<Org, Iterable<VAppTemplate>>
public Iterable<VAppTemplate> apply(Org from) {
Iterable<CatalogItem> catalogs = allCatalogItemsInOrg.apply(from);
Iterable<VAppTemplate> vAppTemplates = vAppTemplatesForCatalogItems.apply(catalogs);
return filter(vAppTemplates, and(notNull(), new Predicate<VAppTemplate>(){
return filter(vAppTemplates, and(notNull(), new Predicate<VAppTemplate>() {
@Override
public boolean apply(VAppTemplate input) {
if (input == null)

View File

@ -159,7 +159,7 @@ public class InstantiateVAppTemplateOptions {
}
@Override
public String toString(){
public String toString() {
return string().toString();
}

View File

@ -47,7 +47,7 @@ public class InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployA
String ns = "http://www.vmware.com/vcloud/v1";
Properties outputProperties;
public InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOnExpectTest(){
public InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOnExpectTest() {
outputProperties = new Properties();
outputProperties.put(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes");
}

View File

@ -89,7 +89,7 @@ public class BlobToHttpGetOptionsTest {
}
@Test
public void testRanges(){
public void testRanges() {
org.jclouds.blobstore.options.GetOptions in = new org.jclouds.blobstore.options.GetOptions();
in.range(0,1024);
in.startAt(2048);
@ -103,7 +103,7 @@ public class BlobToHttpGetOptionsTest {
}
@Test
public void testRangesTail(){
public void testRangesTail() {
org.jclouds.blobstore.options.GetOptions in = new org.jclouds.blobstore.options.GetOptions();
in.tail(1024);
@ -114,7 +114,7 @@ public class BlobToHttpGetOptionsTest {
}
@Test
public void testRangesStart(){
public void testRangesStart() {
org.jclouds.blobstore.options.GetOptions in = new org.jclouds.blobstore.options.GetOptions();
in.startAt(1024);

View File

@ -124,7 +124,7 @@ public class Link {
return this;
}
public Link build(){
public Link build() {
return new Link(relation, type, href);
}

View File

@ -112,7 +112,7 @@ public class BlockUntilInitScriptStatusIsZeroThenReturnOutput extends AbstractFu
*/
static Predicate<String> loopUntilTrueOrThrowCancellationException(Predicate<String> predicate, long period, long maxPeriod,
final AbstractFuture<ExecResponse> futureWhichMightBeCancelled) {
return retry(Predicates.<String> and(predicate, new Predicate<String>(){
return retry(Predicates.<String> and(predicate, new Predicate<String>() {
public boolean apply(String in) {
if (futureWhichMightBeCancelled.isCancelled())
throw new CancellationException(futureWhichMightBeCancelled + " is cancelled");

View File

@ -117,7 +117,7 @@ public abstract class BaseComputeServiceContextModule extends AbstractModule {
install(new FactoryModuleBuilder().build(BlockUntilInitScriptStatusIsZeroThenReturnOutput.Factory.class));
}
protected void bindCredentialsOverriderFunction(){
protected void bindCredentialsOverriderFunction() {
bind(new TypeLiteral<Function<Template, LoginCredentials>>() {
}).to(DefaultCredentialsFromImageOrOverridingCredentials.class);
}
@ -303,13 +303,13 @@ public abstract class BaseComputeServiceContextModule extends AbstractModule {
@Provides
@Singleton
protected Optional<ImageExtension> provideImageExtension(Injector i){
protected Optional<ImageExtension> provideImageExtension(Injector i) {
return Optional.absent();
}
@Provides
@Singleton
protected Optional<SecurityGroupExtension> provideSecurityGroupExtension(Injector i){
protected Optional<SecurityGroupExtension> provideSecurityGroupExtension(Injector i) {
return Optional.absent();
}

View File

@ -163,7 +163,7 @@ public class TemplateBuilderImpl implements TemplateBuilder {
};
}
final Predicate<ComputeMetadata> locationPredicate = new NullEqualToIsParentOrIsGrandparentOfCurrentLocation(new Supplier<Location>(){
final Predicate<ComputeMetadata> locationPredicate = new NullEqualToIsParentOrIsGrandparentOfCurrentLocation(new Supplier<Location>() {
@Override
public Location get() {
@ -1079,13 +1079,13 @@ public class TemplateBuilderImpl implements TemplateBuilder {
toString.add("imageVersion", imageVersion);
if (location != null)
toString.add("locationId", location.getId());
if (minCores >0) //TODO: make non-primitive
if (minCores > 0) //TODO: make non-primitive
toString.add("minCores", minCores);
if (minRam >0) //TODO: make non-primitive
if (minRam > 0) //TODO: make non-primitive
toString.add("minRam", minRam);
if (minRam >0) //TODO: make non-primitive
if (minRam > 0) //TODO: make non-primitive
toString.add("minRam", minRam);
if (minDisk >0) //TODO: make non-primitive
if (minDisk > 0) //TODO: make non-primitive
toString.add("minDisk", minDisk);
toString.add("osFamily", osFamily);
toString.add("osName", osName);

View File

@ -97,7 +97,7 @@ public class ImagePredicates {
@Override
public String toString() {
return "metadataContains(" + key +", "+value + ")";
return "metadataContains(" + key + ", " + value + ")";
}
};
}

View File

@ -44,7 +44,7 @@ public class StubApiMetadata extends BaseApiMetadata {
public static class Builder extends BaseApiMetadata.Builder<Builder> {
protected Builder(){
protected Builder() {
id("stub")
.name("in-memory (Stub) API")
.identityName("Unused")

View File

@ -22,7 +22,7 @@ import java.net.URI;
*
* @author Adrian Cole
*/
public class Disk implements Comparable<Disk>{
public class Disk implements Comparable<Disk> {
public static Builder builder() {
return new Builder();
}

View File

@ -83,7 +83,7 @@ public class StubComputeServiceIntegrationTest extends BaseComputeServiceLiveTes
socketTester = retry(socketOpen, 1, 1, MILLISECONDS);
openSocketFinder = new OpenSocketFinder(){
openSocketFinder = new OpenSocketFinder() {
@Override
public HostAndPort findOpenSocketOnNode(NodeMetadata node, int port, long timeoutValue, TimeUnit timeUnits) {

View File

@ -80,7 +80,7 @@ public class RsaSshKeyPairGeneratorTest {
replay(crypto, rsaKeyPairGenerator, secureRandom);
RsaSshKeyPairGenerator supplier = Guice.createInjector(new AbstractModule(){
RsaSshKeyPairGenerator supplier = Guice.createInjector(new AbstractModule() {
protected void configure() {
bind(Crypto.class).toInstance(crypto);
bind(SecureRandom.class).toInstance(secureRandom);

View File

@ -408,11 +408,11 @@ public class ContextBuilder {
}
static Properties resolveProperties(Properties mutable, String providerId, Set<String> keys, Set<String> optionalKeys) throws NoSuchElementException {
for (String key : keys){
for (String key : keys) {
try {
String scopedProperty = ImmutableList.copyOf(Splitter.on('.').split(key)).get(1);
mutable.setProperty(key, searchPropertiesForProviderScopedProperty(mutable, providerId,scopedProperty));
} catch (NoSuchElementException e){
} catch (NoSuchElementException e) {
if (!optionalKeys.contains(key))
throw e;
}

View File

@ -39,7 +39,7 @@ import com.google.inject.Module;
@Beta
public interface ApiMetadata {
public static interface Builder<B extends Builder<B>>{
public static interface Builder<B extends Builder<B>> {
/**
* @see ApiMetadata#getId()
*/

View File

@ -36,7 +36,7 @@ import com.google.common.collect.UnmodifiableIterator;
@Beta
public class AdvanceUntilEmptyIterable<E> extends FluentIterable<FluentIterable<E>> {
public static <E> AdvanceUntilEmptyIterable<E> create(Supplier<FluentIterable<E>> nextIterable){
public static <E> AdvanceUntilEmptyIterable<E> create(Supplier<FluentIterable<E>> nextIterable) {
return new AdvanceUntilEmptyIterable<E>(nextIterable);
}

View File

@ -100,7 +100,7 @@ public class ExecutorServiceModule extends AbstractModule {
@Provides
@Singleton
TimeLimiter timeLimiter(@Named(PROPERTY_USER_THREADS) ListeningExecutorService userExecutor){
TimeLimiter timeLimiter(@Named(PROPERTY_USER_THREADS) ListeningExecutorService userExecutor) {
return new SimpleTimeLimiter(userExecutor);
}

View File

@ -63,15 +63,15 @@ public class JCECrypto implements Crypto {
@Override
public Mac hmac(String algorithm, byte[] key) throws NoSuchAlgorithmException, InvalidKeyException {
Mac mac = null;
if(provider != null) {
if (provider != null) {
try {
mac = Mac.getInstance(algorithm, provider);
} catch(Exception e) {
} catch (Exception e) {
//Provider does not function.
//Do nothing and let it fallback to the default way.
}
}
if(mac == null) {
if (mac == null) {
mac = Mac.getInstance(algorithm);
}
SecretKeySpec signingKey = new SecretKeySpec(key, algorithm);

View File

@ -191,7 +191,7 @@ public class JavaUrlHttpCommandExecutorService extends BaseHttpCommandExecutorSe
}
String host = request.getEndpoint().getHost();
if(request.getEndpoint().getPort() != -1) {
if (request.getEndpoint().getPort() != -1) {
host += ":" + request.getEndpoint().getPort();
}
connection.setRequestProperty(HOST, host);

View File

@ -131,7 +131,7 @@ public class LocationModule extends AbstractModule {
Suppliers.compose(new FilterStrings(filter), uncached), seconds, TimeUnit.SECONDS);
}
static class FilterStrings implements Function<Set<String>, Set<String>>{
static class FilterStrings implements Function<Set<String>, Set<String>> {
public final Predicate<String> filter;
public FilterStrings(Predicate<String> filter) {

View File

@ -58,7 +58,7 @@ public class RegionToEndpointOrProviderIfNull implements Function<Object, URI> {
return defaultUri.get();
checkArgument(from instanceof String, "region is a String argument");
Map<String, Supplier<URI>> regionToEndpoint = regionToEndpointSupplier.get();
if (from.equals(defaultProvider)){
if (from.equals(defaultProvider)) {
if (regionToEndpoint.containsKey(from))
return regionToEndpoint.get(from).get();
return defaultUri.get();

View File

@ -37,7 +37,7 @@ import com.google.common.collect.ImmutableMap.Builder;
import com.google.inject.assistedinject.Assisted;
@Singleton
public class LocationIdToURIFromConfigurationOrDefaultToProvider implements Supplier<Map<String, Supplier<URI>>>{
public class LocationIdToURIFromConfigurationOrDefaultToProvider implements Supplier<Map<String, Supplier<URI>>> {
@Resource
protected Logger logger = Logger.NULL;

View File

@ -116,7 +116,7 @@ public class BindLoggersAnnotatedWithResource implements TypeListener {
Logger logger = loggerFactory.getLogger(type.getName());
for (Field field : loggerFields) {
if (field.isAnnotationPresent(Named.class)){
if (field.isAnnotationPresent(Named.class)) {
Named name = field.getAnnotation(Named.class);
encounter.register(new AssignLoggerToField<I>(loggerFactory.getLogger(name.value()), field));
} else {

View File

@ -124,7 +124,7 @@ public abstract class BaseApiLiveTest<A extends Closeable> {
if (provider != null)
try {
return ContextBuilder.newBuilder(provider);
} catch (NoSuchElementException e){
} catch (NoSuchElementException e) {
Logger.getAnonymousLogger()
.warning("provider ["
+ provider

View File

@ -123,7 +123,7 @@ public abstract class BaseContextLiveTest<C extends Context> {
if (provider != null)
try {
return ContextBuilder.newBuilder(provider);
} catch (NoSuchElementException e){
} catch (NoSuchElementException e) {
Logger.getAnonymousLogger()
.warning("provider ["
+ provider

View File

@ -31,7 +31,7 @@ import com.google.inject.Module;
*
* @author Adrian Cole
*/
public abstract class BaseViewLiveTest<V extends View> extends BaseContextLiveTest<Context>{
public abstract class BaseViewLiveTest<V extends View> extends BaseContextLiveTest<Context> {
protected volatile V view;

View File

@ -48,7 +48,7 @@ public class JcloudsTestBlobStoreApiMetadata extends BaseRestApiMetadata {
public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
protected Builder(){
protected Builder() {
super(IntegrationTestClient.class, IntegrationTestAsyncClient.class);
id("test-blobstore-api")
.view(Storage.class)

View File

@ -48,7 +48,7 @@ public class JcloudsTestComputeApiMetadata extends BaseRestApiMetadata {
public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
protected Builder(){
protected Builder() {
super(IntegrationTestClient.class, IntegrationTestAsyncClient.class);
id("test-compute-api")
.view(Compute.class)

View File

@ -48,7 +48,7 @@ public class JcloudsTestYetAnotherComputeApiMetadata extends BaseRestApiMetadata
public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
protected Builder(){
protected Builder() {
super(IntegrationTestClient.class, IntegrationTestAsyncClient.class);
id("test-yet-another-compute-api")
.view(Compute.class)

Some files were not shown because too many files have changed in this diff Show More