Browse Source

Merge pull request #17785 from SaberMaycry

* pr/17785:
  Polish "Simplify if statements"
  Simplify if statements

Closes gh-17785
pull/17825/head
Stephane Nicoll 7 years ago
parent
commit
9d4671ac72
  1. 2
      spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ConfigurationMetadata.java
  2. 11
      spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/LaunchScriptConfiguration.java
  3. 5
      spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/PropertiesMergingResourceTransformer.java

2
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ConfigurationMetadata.java

@ -165,7 +165,7 @@ public class ConfigurationMetadata { @@ -165,7 +165,7 @@ public class ConfigurationMetadata {
if (o1 == o2) {
return true;
}
return o1 != null && o2 != null && o1.equals(o2);
return o1 != null && o1.equals(o2);
}
public static String nestedPrefix(String prefix, String name) {

11
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/LaunchScriptConfiguration.java

@ -106,17 +106,14 @@ public class LaunchScriptConfiguration implements Serializable { @@ -106,17 +106,14 @@ public class LaunchScriptConfiguration implements Serializable {
return false;
}
if (this.script == null) {
if (other.script != null) {
return false;
}
return other.script == null;
}
else if (!this.script.equals(other.script)) {
return false;
}
else if (!equalContents(this.script, other.script)) {
return false;
else {
return equalContents(this.script, other.script);
}
return true;
}
private boolean equalContents(File one, File two) {
@ -132,7 +129,7 @@ public class LaunchScriptConfiguration implements Serializable { @@ -132,7 +129,7 @@ public class LaunchScriptConfiguration implements Serializable {
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((this.properties == null) ? 0 : this.properties.hashCode());
result = prime * result + this.properties.hashCode();
result = prime * result + ((this.script == null) ? 0 : this.script.hashCode());
return result;
}

5
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/PropertiesMergingResourceTransformer.java

@ -52,10 +52,7 @@ public class PropertiesMergingResourceTransformer implements ResourceTransformer @@ -52,10 +52,7 @@ public class PropertiesMergingResourceTransformer implements ResourceTransformer
@Override
public boolean canTransformResource(String resource) {
if (this.resource != null && this.resource.equalsIgnoreCase(resource)) {
return true;
}
return false;
return this.resource != null && this.resource.equalsIgnoreCase(resource);
}
@Override

Loading…
Cancel
Save