Commit 7712f9c0 authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #17884 from thelproad

* pr/17884:
  Simplify if statements

Closes gh-17884
parents fc0cee5e 9c1f503e
...@@ -49,7 +49,7 @@ final class Elements { ...@@ -49,7 +49,7 @@ final class Elements {
if (type instanceof DeclaredType) { if (type instanceof DeclaredType) {
DeclaredType declaredType = (DeclaredType) type; DeclaredType declaredType = (DeclaredType) type;
Element enclosingElement = declaredType.asElement().getEnclosingElement(); Element enclosingElement = declaredType.asElement().getEnclosingElement();
if (enclosingElement != null && enclosingElement instanceof TypeElement) { if (enclosingElement instanceof TypeElement) {
return (TypeElement) enclosingElement; return (TypeElement) enclosingElement;
} }
} }
......
...@@ -109,7 +109,7 @@ public abstract class SystemPropertyUtils { ...@@ -109,7 +109,7 @@ public abstract class SystemPropertyUtils {
placeholder = parseStringValue(properties, value, placeholder, visitedPlaceholders); placeholder = parseStringValue(properties, value, placeholder, visitedPlaceholders);
// Now obtain the value for the fully resolved key... // Now obtain the value for the fully resolved key...
String propVal = resolvePlaceholder(properties, value, placeholder); String propVal = resolvePlaceholder(properties, value, placeholder);
if (propVal == null && VALUE_SEPARATOR != null) { if (propVal == null) {
int separatorIndex = placeholder.indexOf(VALUE_SEPARATOR); int separatorIndex = placeholder.indexOf(VALUE_SEPARATOR);
if (separatorIndex != -1) { if (separatorIndex != -1) {
String actualPlaceholder = placeholder.substring(0, separatorIndex); String actualPlaceholder = placeholder.substring(0, separatorIndex);
......
...@@ -59,7 +59,7 @@ class OutputCapture implements CapturedOutput { ...@@ -59,7 +59,7 @@ class OutputCapture implements CapturedOutput {
if (obj == this) { if (obj == this) {
return true; return true;
} }
if (obj instanceof CapturedOutput || obj instanceof CharSequence) { if (obj instanceof CharSequence) {
return getAll().equals(obj.toString()); return getAll().equals(obj.toString());
} }
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment