Commit 1c8f7278 authored by Stephane Nicoll's avatar Stephane Nicoll

Polish "Simplify if statements"

See gh-17785
parent c6c3a91f
...@@ -157,7 +157,10 @@ public final class Metadata { ...@@ -157,7 +157,10 @@ public final class Metadata {
if (this.deprecation == null && itemMetadata.getDeprecation() != null) { if (this.deprecation == null && itemMetadata.getDeprecation() != null) {
return false; return false;
} }
return this.deprecation == null || this.deprecation.equals(itemMetadata.getDeprecation()); if (this.deprecation != null && !this.deprecation.equals(itemMetadata.getDeprecation())) {
return false;
}
return true;
} }
public MetadataItemCondition ofType(Class<?> dataType) { public MetadataItemCondition ofType(Class<?> dataType) {
...@@ -339,7 +342,10 @@ public final class Metadata { ...@@ -339,7 +342,10 @@ public final class Metadata {
if (this.value != null && !this.value.equals(valueHint.getValue())) { if (this.value != null && !this.value.equals(valueHint.getValue())) {
return false; return false;
} }
return this.description == null || this.description.equals(valueHint.getDescription()); if (this.description != null && !this.description.equals(valueHint.getDescription())) {
return false;
}
return true;
} }
} }
......
...@@ -381,7 +381,10 @@ public abstract class MainClassFinder { ...@@ -381,7 +381,10 @@ public abstract class MainClassFinder {
return false; return false;
} }
MainClass other = (MainClass) obj; MainClass other = (MainClass) obj;
return this.name.equals(other.name); if (!this.name.equals(other.name)) {
return false;
}
return true;
} }
@Override @Override
......
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