Skip to content
Permalink
Browse files
error-prone 2.3.2 fixes
  • Loading branch information
gaul committed Oct 14, 2018
1 parent ff3bdab commit d5da73892951ac3e018052fd7e71923923f8c571
Showing 8 changed files with 19 additions and 23 deletions.
@@ -178,7 +178,7 @@ private void validateVSwitchId(String regionId,
String securityGroupName,
String vpcIdFromSecurityGroup) {
Optional<VSwitch> optionalVSwitch = tryFindVSwitchInVPC(regionId, vpcIdFromSecurityGroup, vSwitchId);
if (!optionalVSwitch.isPresent()) {
if (optionalVSwitch.isPresent()) {
String message = String.format("security group (%s) and vSwitch (%s) must be in the same VPC_PREFIX (%s)",
securityGroupName,
optionalVSwitch.get().name(),
@@ -28,11 +28,11 @@

public final class ListVMImagesHandler extends ParseSax.HandlerForGeneratedRequestWithResult<List<VMImage>> {
private boolean inVMImage;
private final VMImageHandler VMImageHandler;
private final VMImageHandler vmImageHandler;
private final Builder<VMImage> images = ImmutableList.builder();

@Inject ListVMImagesHandler(VMImageHandler vmImageHandler) {
this.VMImageHandler = vmImageHandler;
this.vmImageHandler = vmImageHandler;
}

@Override
@@ -46,25 +46,25 @@ public void startElement(String url, String name, String qName, Attributes attri
inVMImage = true;
}
if (inVMImage) {
VMImageHandler.startElement(url, name, qName, attributes);
vmImageHandler.startElement(url, name, qName, attributes);
}
}

@Override
public void endElement(String uri, String name, String qName) {
if (qName.equals("VMImage")) {
inVMImage = false;
images.add(VMImageHandler.getResult());
images.add(vmImageHandler.getResult());
}
if (inVMImage) {
VMImageHandler.endElement(uri, name, qName);
vmImageHandler.endElement(uri, name, qName);
}
}

@Override
public void characters(char[] ch, int start, int length) {
if (inVMImage) {
VMImageHandler.characters(ch, start, length);
vmImageHandler.characters(ch, start, length);
}
}
}
@@ -108,8 +108,8 @@ public void testOperatingSystem() {

List<OSImage> images = createOSImage();
for (int i = 0; i < images.size(); i++) {
OSImage OSImage = images.get(i);
OperatingSystem os = OSImageToImage.osFamily().apply(OSImage).build();
OSImage osImage = images.get(i);
OperatingSystem os = OSImageToImage.osFamily().apply(osImage).build();
assertEquals(os.getFamily(), osFamily.get(i));
assertEquals(os.getVersion(), version.get(i));
}
@@ -42,12 +42,12 @@ public void testCreateLinux() throws Exception {
try {
DeploymentApi api = api(server.getUrl("/")).getDeploymentApiForService("myservice");

OSImage OSImage = ListOSImagesHandlerTest.expected().get(5); // Centos
OSImage osImage = ListOSImagesHandlerTest.expected().get(5); // Centos

DeploymentParams params = DeploymentParams.builder()
.name("mydeployment")
.size(RoleSize.Type.MEDIUM)
.sourceImageName(OSImage.name()).mediaLink(URI.create("https://mydeployment.blob.core.windows.net/vhds/disk-mydeployment.vhd")).os(OSImage.os())
.sourceImageName(osImage.name()).mediaLink(URI.create("https://mydeployment.blob.core.windows.net/vhds/disk-mydeployment.vhd")).os(osImage.os())
.username("username").password("testpwd")
.virtualNetworkName("my-virtualNetworkName")
.reservedIPName("myreservedip")
@@ -69,12 +69,12 @@ public void testCreateWindows() throws Exception {
try {
DeploymentApi api = api(server.getUrl("/")).getDeploymentApiForService("myservice");

OSImage OSImage = ListOSImagesHandlerTest.expected().get(1); // Windows
OSImage osImage = ListOSImagesHandlerTest.expected().get(1); // Windows

DeploymentParams params = DeploymentParams.builder()
.name("mydeployment")
.size(RoleSize.Type.MEDIUM)
.sourceImageName(OSImage.name()).mediaLink(OSImage.mediaLink()).os(OSImage.os())
.sourceImageName(osImage.name()).mediaLink(osImage.mediaLink()).os(osImage.os())
.username("username").password("testpwd")
.virtualNetworkName("my-virtualNetworkName")
.externalEndpoints(ImmutableSet.of(inboundTcpToLocalPort(80, 8080), inboundUdpToLocalPort(53, 53)))
@@ -156,8 +156,8 @@ public void testUpdateVMImage() {
public void testList() {
List<VMImage> vmImageList = api().list();
assertTrue(vmImageList.size() > 0);
for (VMImage VMImage : vmImageList) {
checkVMImage(VMImage);
for (VMImage vmImage : vmImageList) {
checkVMImage(vmImage);
}
}

@@ -63,10 +63,6 @@ public void testCreateDataObjectsNonCDMI() throws Exception {
byte[] bytes;
DataObject dataObject;
Map<String, String> pContainerMetaDataIn = Maps.newHashMap();
Map<String, String> pDataObjectMetaDataIn = Maps.newLinkedHashMap();
pDataObjectMetaDataIn.put("dataObjectkey1", "value1");
pDataObjectMetaDataIn.put("dataObjectkey2", "value2");
pDataObjectMetaDataIn.put("dataObjectkey3", "value3");

Payload payloadIn;
Payload payloadOut;
@@ -56,7 +56,7 @@ public abstract class Server {
public abstract Dvd dvd();

@Nullable
public abstract Snapshot Snapshot();
public abstract Snapshot snapshot();

@Nullable
public abstract DataCenter datacenter();
@@ -149,7 +149,7 @@ public abstract static class UpdateServerResponse {
public abstract Dvd dvd();

@Nullable
public abstract Snapshot Snapshot();
public abstract Snapshot snapshot();

@Nullable
public abstract DataCenter datacenter();
@@ -139,7 +139,7 @@ public void testListSnapshot() throws InterruptedException {
public void testRestoreSnapshot() throws InterruptedException {
assertNodeAvailable(currentServer);
currentServer = serverApi().get(currentServer.id());
Server response = serverApi().restoreSnapshot(currentServer.id(), currentServer.Snapshot().id());
Server response = serverApi().restoreSnapshot(currentServer.id(), currentServer.snapshot().id());

assertNotNull(response);
}
@@ -157,7 +157,7 @@ public void testDeleteSnapshot() throws InterruptedException {
assertNodeAvailable(currentServer);
Thread.sleep(120000);
currentServer = serverApi().get(currentServer.id());
Server response = serverApi().deleteSnapshot(currentServer.id(), currentServer.Snapshot().id());
Server response = serverApi().deleteSnapshot(currentServer.id(), currentServer.snapshot().id());

assertNotNull(response);
}

0 comments on commit d5da738

Please sign in to comment.