Polish 'Simplify some code'

See gh-18438
pull/18477/head
Phillip Webb 5 years ago
parent e6b45de41e
commit b65ba60980

@ -56,7 +56,7 @@ class OverrideAutoConfigurationContextCustomizerFactory implements ContextCustom
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
return (obj != null && obj.getClass() == getClass()); return (obj != null) && (obj.getClass() == getClass());
} }
@Override @Override

@ -71,8 +71,8 @@ class TypeExcludeFiltersContextCustomizer implements ContextCustomizer {
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
return (obj != null && getClass() == obj.getClass() return (obj != null) && (getClass() == obj.getClass())
&& this.filters.equals(((TypeExcludeFiltersContextCustomizer) obj).filters)); && this.filters.equals(((TypeExcludeFiltersContextCustomizer) obj).filters);
} }
@Override @Override

@ -57,8 +57,8 @@ class PropertyMappingContextCustomizer implements ContextCustomizer {
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
return (obj != null && getClass() == obj.getClass() return (obj != null) && (getClass() == obj.getClass())
&& this.propertySource.equals(((PropertyMappingContextCustomizer) obj).propertySource)); && this.propertySource.equals(((PropertyMappingContextCustomizer) obj).propertySource);
} }
@Override @Override

@ -37,10 +37,7 @@ class ExcludeFilterContextCustomizer implements ContextCustomizer {
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == this) { return (obj != null) && (getClass() == obj.getClass());
return true;
}
return obj != null && getClass() == obj.getClass();
} }
@Override @Override

@ -80,7 +80,7 @@ class DuplicateJsonObjectContextCustomizerFactory implements ContextCustomizerFa
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
return obj != null && obj.getClass() == getClass(); return (obj != null) && (getClass() == obj.getClass());
} }
@Override @Override

@ -208,8 +208,8 @@ class OutputCapture implements CapturedOutput {
} }
private static PrintStream getSystemStream(PrintStream printStream) { private static PrintStream getSystemStream(PrintStream printStream) {
if (printStream instanceof PrintStreamCapture) { while (printStream instanceof PrintStreamCapture) {
return ((PrintStreamCapture) printStream).getParent(); printStream = ((PrintStreamCapture) printStream).getParent();
} }
return printStream; return printStream;
} }

@ -78,7 +78,7 @@ class TestRestTemplateContextCustomizer implements ContextCustomizer {
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
return obj != null && obj.getClass() == getClass(); return (obj != null) && (obj.getClass() == getClass());
} }
@Override @Override

@ -79,7 +79,7 @@ class WebTestClientContextCustomizer implements ContextCustomizer {
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
return (obj != null && obj.getClass() == getClass()); return (obj != null) && (obj.getClass() == getClass());
} }
@Override @Override

Loading…
Cancel
Save