Polish "Simplify if statements"

See gh-17785
This commit is contained in:
Stephane Nicoll 2019-08-08 14:35:29 +02:00
parent c6c3a91f8d
commit 1c8f727864
2 changed files with 12 additions and 3 deletions

View File

@ -157,7 +157,10 @@ public final class Metadata {
if (this.deprecation == null && itemMetadata.getDeprecation() != null) {
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) {
@ -339,7 +342,10 @@ public final class Metadata {
if (this.value != null && !this.value.equals(valueHint.getValue())) {
return false;
}
return this.description == null || this.description.equals(valueHint.getDescription());
if (this.description != null && !this.description.equals(valueHint.getDescription())) {
return false;
}
return true;
}
}

View File

@ -381,7 +381,10 @@ public abstract class MainClassFinder {
return false;
}
MainClass other = (MainClass) obj;
return this.name.equals(other.name);
if (!this.name.equals(other.name)) {
return false;
}
return true;
}
@Override