Browse Source

Simplify if statements

See gh-17884
pull/17893/head
thelproad 7 years ago committed by Stephane Nicoll
parent
commit
9c1f503e46
  1. 2
      spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/java/org/springframework/boot/autoconfigureprocessor/Elements.java
  2. 2
      spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/util/SystemPropertyUtils.java
  3. 2
      spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/system/OutputCapture.java

2
spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/java/org/springframework/boot/autoconfigureprocessor/Elements.java

@ -49,7 +49,7 @@ final class Elements { @@ -49,7 +49,7 @@ final class Elements {
if (type instanceof DeclaredType) {
DeclaredType declaredType = (DeclaredType) type;
Element enclosingElement = declaredType.asElement().getEnclosingElement();
if (enclosingElement != null && enclosingElement instanceof TypeElement) {
if (enclosingElement instanceof TypeElement) {
return (TypeElement) enclosingElement;
}
}

2
spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/util/SystemPropertyUtils.java

@ -109,7 +109,7 @@ public abstract class SystemPropertyUtils { @@ -109,7 +109,7 @@ public abstract class SystemPropertyUtils {
placeholder = parseStringValue(properties, value, placeholder, visitedPlaceholders);
// Now obtain the value for the fully resolved key...
String propVal = resolvePlaceholder(properties, value, placeholder);
if (propVal == null && VALUE_SEPARATOR != null) {
if (propVal == null) {
int separatorIndex = placeholder.indexOf(VALUE_SEPARATOR);
if (separatorIndex != -1) {
String actualPlaceholder = placeholder.substring(0, separatorIndex);

2
spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/system/OutputCapture.java

@ -59,7 +59,7 @@ class OutputCapture implements CapturedOutput { @@ -59,7 +59,7 @@ class OutputCapture implements CapturedOutput {
if (obj == this) {
return true;
}
if (obj instanceof CapturedOutput || obj instanceof CharSequence) {
if (obj instanceof CharSequence) {
return getAll().equals(obj.toString());
}
return false;

Loading…
Cancel
Save