Inline redundant if statements

See gh-39259
This commit is contained in:
Tobias Lippert
2024-01-21 18:42:27 +01:00
committed by Phillip Webb
parent 9cdd0c3776
commit def7523398
18 changed files with 24 additions and 76 deletions

View File

@@ -157,10 +157,7 @@ public final class Metadata {
if (this.deprecation == null && itemMetadata.getDeprecation() != null) {
return false;
}
if (this.deprecation != null && !this.deprecation.equals(itemMetadata.getDeprecation())) {
return false;
}
return true;
return this.deprecation == null || this.deprecation.equals(itemMetadata.getDeprecation());
}
public MetadataItemCondition ofType(Class<?> dataType) {
@@ -348,10 +345,7 @@ public final class Metadata {
if (this.value != null && !this.value.equals(valueHint.getValue())) {
return false;
}
if (this.description != null && !this.description.equals(valueHint.getDescription())) {
return false;
}
return true;
return this.description == null || this.description.equals(valueHint.getDescription());
}
}