Fix checkstyle method order issues

Fix checkstyle issues with method ordering following the
spring-javaformat upgrade.

See gh-13932
This commit is contained in:
Phillip Webb
2018-07-27 15:45:33 +01:00
parent e6a68b39a3
commit 63b609827e
58 changed files with 606 additions and 606 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -62,13 +62,13 @@ class OverrideAutoConfigurationContextCustomizerFactory
}
@Override
public int hashCode() {
return getClass().hashCode();
public boolean equals(Object obj) {
return (obj != null && obj.getClass() == getClass());
}
@Override
public boolean equals(Object obj) {
return (obj != null && obj.getClass() == getClass());
public int hashCode() {
return getClass().hashCode();
}
}

View File

@@ -117,21 +117,6 @@ public abstract class AnnotationCustomizableTypeExcludeFilter extends TypeExclud
}
@Override
public int hashCode() {
final int prime = 31;
int result = 0;
result = prime * result + Boolean.hashCode(hasAnnotation());
for (FilterType filterType : FilterType.values()) {
result = prime * result
+ ObjectUtils.nullSafeHashCode(getFilters(filterType));
}
result = prime * result + Boolean.hashCode(isUseDefaultFilters());
result = prime * result + ObjectUtils.nullSafeHashCode(getDefaultIncludes());
result = prime * result + ObjectUtils.nullSafeHashCode(getComponentIncludes());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
@@ -155,4 +140,19 @@ public abstract class AnnotationCustomizableTypeExcludeFilter extends TypeExclud
return result;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 0;
result = prime * result + Boolean.hashCode(hasAnnotation());
for (FilterType filterType : FilterType.values()) {
result = prime * result
+ ObjectUtils.nullSafeHashCode(getFilters(filterType));
}
result = prime * result + Boolean.hashCode(isUseDefaultFilters());
result = prime * result + ObjectUtils.nullSafeHashCode(getDefaultIncludes());
result = prime * result + ObjectUtils.nullSafeHashCode(getComponentIncludes());
return result;
}
}

View File

@@ -73,17 +73,17 @@ class TypeExcludeFiltersContextCustomizer implements ContextCustomizer {
}
}
@Override
public int hashCode() {
return this.filters.hashCode();
}
@Override
public boolean equals(Object obj) {
return (obj != null && getClass() == obj.getClass() && this.filters
.equals(((TypeExcludeFiltersContextCustomizer) obj).filters));
}
@Override
public int hashCode() {
return this.filters.hashCode();
}
@Override
public void customizeContext(ConfigurableApplicationContext context,
MergedContextConfiguration mergedContextConfiguration) {

View File

@@ -201,11 +201,6 @@ public class AnnotationsPropertySource extends EnumerablePropertySource<Class<?>
return this.properties.isEmpty();
}
@Override
public int hashCode() {
return this.properties.hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
@@ -217,4 +212,9 @@ public class AnnotationsPropertySource extends EnumerablePropertySource<Class<?>
return this.properties.equals(((AnnotationsPropertySource) obj).properties);
}
@Override
public int hashCode() {
return this.properties.hashCode();
}
}

View File

@@ -55,17 +55,17 @@ class PropertyMappingContextCustomizer implements ContextCustomizer {
new PropertyMappingCheckBeanPostProcessor());
}
@Override
public int hashCode() {
return this.propertySource.hashCode();
}
@Override
public boolean equals(Object obj) {
return (obj != null && getClass() == obj.getClass() && this.propertySource
.equals(((PropertyMappingContextCustomizer) obj).propertySource));
}
@Override
public int hashCode() {
return this.propertySource.hashCode();
}
/**
* {@link BeanPostProcessor} to check that {@link PropertyMapping} is only used on
* test classes.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -49,11 +49,6 @@ class WebDriverContextCustomizerFactory implements ContextCustomizerFactory {
WebDriverScope.registerWith(context);
}
@Override
public int hashCode() {
return getClass().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
@@ -65,6 +60,11 @@ class WebDriverContextCustomizerFactory implements ContextCustomizerFactory {
return true;
}
@Override
public int hashCode() {
return getClass().hashCode();
}
}
}

View File

@@ -119,13 +119,13 @@ public class TypeExcludeFiltersContextCustomizerFactoryTests {
}
@Override
public int hashCode() {
return SimpleExclude.class.hashCode();
public boolean equals(Object obj) {
return obj.getClass() == getClass();
}
@Override
public boolean equals(Object obj) {
return obj.getClass() == getClass();
public int hashCode() {
return SimpleExclude.class.hashCode();
}
}

View File

@@ -33,11 +33,6 @@ public class ExampleBasicObject {
this.value = value;
}
@Override
public int hashCode() {
return this.value.hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj != null && obj.getClass() == getClass()) {
@@ -46,4 +41,9 @@ public class ExampleBasicObject {
return false;
}
@Override
public int hashCode() {
return this.value.hashCode();
}
}

View File

@@ -29,11 +29,6 @@ public class ExampleCustomObject {
this.value = value;
}
@Override
public int hashCode() {
return this.value.hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj != null && obj.getClass() == getClass()) {
@@ -42,6 +37,11 @@ public class ExampleCustomObject {
return false;
}
@Override
public int hashCode() {
return this.value.hashCode();
}
@Override
public String toString() {
return this.value;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,11 +48,6 @@ public class ExampleJsonObjectWithView {
this.id = id;
}
@Override
public int hashCode() {
return 0;
}
@Override
public boolean equals(Object obj) {
if (obj == null || obj.getClass() != getClass()) {
@@ -63,6 +58,11 @@ public class ExampleJsonObjectWithView {
&& ObjectUtils.nullSafeEquals(this.id, other.id);
}
@Override
public int hashCode() {
return 0;
}
@Override
public String toString() {
return this.value + " " + this.id;