Address confusing operator precedence

Found via error-prone.
This commit is contained in:
Andrew Gaul 2016-07-15 19:05:08 -07:00
parent 2a04a52d56
commit 25baad6d32
4 changed files with 7 additions and 7 deletions

View File

@ -93,8 +93,8 @@ public class BaseEnvelopeHandler<V extends BaseVirtualSystem<V>, B extends BaseV
inNetwork = true;
} else if (equalsOrSuffix(qName, "VirtualSystem")) {
inVirtualSystem = true;
} else if (extensionHandlers.containsKey(qName) || attributes.containsKey("type")
&& extensionHandlers.containsKey(attributes.get("type"))) {
} else if (extensionHandlers.containsKey(qName) || (attributes.containsKey("type")
&& extensionHandlers.containsKey(attributes.get("type")))) {
inExtensionSection = true;
extensionHandler = extensionHandlers.get(qName).get();
} else if (qName.endsWith("Section")) {

View File

@ -418,8 +418,8 @@ public class StubComputeServiceIntegrationTest extends BaseComputeServiceLiveTes
if (o == null || !this.getClass().equals(o.getClass()))
return false;
PayloadEquals other = (PayloadEquals) o;
return this.expected == null && other.expected == null || this.expected != null
&& this.expected.equals(other.expected);
return (this.expected == null && other.expected == null) ||
(this.expected != null && this.expected.equals(other.expected));
}
@Override

View File

@ -179,8 +179,8 @@ public class CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions
@Override
protected boolean userSpecifiedTheirOwnGroups(TemplateOptions options) {
return options instanceof AWSEC2TemplateOptions
&& !AWSEC2TemplateOptions.class.cast(options).getGroupIds().isEmpty()
return (options instanceof AWSEC2TemplateOptions
&& !AWSEC2TemplateOptions.class.cast(options).getGroupIds().isEmpty())
|| super.userSpecifiedTheirOwnGroups(options);
}

View File

@ -183,7 +183,7 @@ public final class GoogleComputeEngineServiceAdapter
// Add lookup for InstanceToNodeMetadata
diskURIToImage.getUnchecked(instance.get().disks().get(0).source());
if (options.autoCreateWindowsPassword() != null && options.autoCreateWindowsPassword()
if ((options.autoCreateWindowsPassword() != null && options.autoCreateWindowsPassword())
|| OsFamily.WINDOWS == template.getImage().getOperatingSystem().getFamily()) {
Map<String, ?> params = ImmutableMap.of("instance", instance, "zone", zone, "email", create.user(), "userName", credentials.getUser());
String password = windowsPasswordGenerator.apply(params);