Commit b65ba609 authored by Phillip Webb's avatar Phillip Webb

Polish 'Simplify some code'

See gh-18438
parent e6b45de4
...@@ -56,7 +56,7 @@ class OverrideAutoConfigurationContextCustomizerFactory implements ContextCustom ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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
......
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