Consistent equals/hashCode style (and related polishing)
This commit is contained in:
@@ -47,7 +47,6 @@ class DynamicPropertiesContextCustomizer implements ContextCustomizer {
|
||||
|
||||
private static final String PROPERTY_SOURCE_NAME = "Dynamic Test Properties";
|
||||
|
||||
|
||||
private final Set<Method> methods;
|
||||
|
||||
|
||||
@@ -66,9 +65,7 @@ class DynamicPropertiesContextCustomizer implements ContextCustomizer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void customizeContext(ConfigurableApplicationContext context,
|
||||
MergedContextConfiguration mergedConfig) {
|
||||
|
||||
public void customizeContext(ConfigurableApplicationContext context, MergedContextConfiguration mergedConfig) {
|
||||
MutablePropertySources sources = context.getEnvironment().getPropertySources();
|
||||
sources.addFirst(new DynamicValuesPropertySource(PROPERTY_SOURCE_NAME, buildDynamicPropertiesMap()));
|
||||
}
|
||||
@@ -91,20 +88,16 @@ class DynamicPropertiesContextCustomizer implements ContextCustomizer {
|
||||
return this.methods;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other || (other instanceof DynamicPropertiesContextCustomizer that &&
|
||||
this.methods.equals(that.methods)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.methods.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
return this.methods.equals(((DynamicPropertiesContextCustomizer) obj).methods);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user