Simplify if statements
See gh-17785
This commit is contained in:
@@ -165,7 +165,7 @@ public class ConfigurationMetadata {
|
||||
if (o1 == o2) {
|
||||
return true;
|
||||
}
|
||||
return o1 != null && o2 != null && o1.equals(o2);
|
||||
return o1 != null && o1.equals(o2);
|
||||
}
|
||||
|
||||
public static String nestedPrefix(String prefix, String name) {
|
||||
|
||||
@@ -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) {
|
||||
@@ -342,10 +339,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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user