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

@@ -115,11 +115,6 @@ class ImportsContextCustomizer implements ContextCustomizer {
return registry.getBeanDefinition(beanName);
}
@Override
public int hashCode() {
return this.key.hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
@@ -133,6 +128,11 @@ class ImportsContextCustomizer implements ContextCustomizer {
return this.key.equals(other.key);
}
@Override
public int hashCode() {
return this.key.hashCode();
}
@Override
public String toString() {
return new ToStringCreator(this).append("key", this.key).toString();
@@ -338,17 +338,17 @@ class ImportsContextCustomizer implements ContextCustomizer {
}
}
@Override
public int hashCode() {
return this.key.hashCode();
}
@Override
public boolean equals(Object obj) {
return (obj != null && getClass() == obj.getClass()
&& this.key.equals(((ContextCustomizerKey) obj).key));
}
@Override
public int hashCode() {
return this.key.hashCode();
}
@Override
public String toString() {
return this.key.toString();

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.
@@ -36,11 +36,6 @@ class ExcludeFilterContextCustomizer implements ContextCustomizer {
new TestTypeExcludeFilter());
}
@Override
public int hashCode() {
return getClass().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
@@ -52,4 +47,9 @@ class ExcludeFilterContextCustomizer implements ContextCustomizer {
return true;
}
@Override
public int hashCode() {
return getClass().hashCode();
}
}

View File

@@ -86,11 +86,6 @@ class DuplicateJsonObjectContextCustomizerFactory implements ContextCustomizerFa
this.logger.warn(message);
}
@Override
public int hashCode() {
return getClass().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null || obj.getClass() != getClass()) {
@@ -99,6 +94,11 @@ class DuplicateJsonObjectContextCustomizerFactory implements ContextCustomizerFa
return true;
}
@Override
public int hashCode() {
return getClass().hashCode();
}
}
}

View File

@@ -76,17 +76,6 @@ abstract class Definition {
return this.qualifier;
}
@Override
public int hashCode() {
int result = 1;
result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.name);
result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.reset);
result = MULTIPLIER * result
+ ObjectUtils.nullSafeHashCode(this.proxyTargetAware);
result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.qualifier);
return result;
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
@@ -105,4 +94,15 @@ abstract class Definition {
return result;
}
@Override
public int hashCode() {
int result = 1;
result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.name);
result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.reset);
result = MULTIPLIER * result
+ ObjectUtils.nullSafeHashCode(this.proxyTargetAware);
result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.qualifier);
return result;
}
}

View File

@@ -100,16 +100,6 @@ class MockDefinition extends Definition {
return this.serializable;
}
@Override
public int hashCode() {
int result = super.hashCode();
result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.typeToMock);
result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.extraInterfaces);
result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.answer);
result = MULTIPLIER * result + Boolean.hashCode(this.serializable);
return result;
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
@@ -128,6 +118,16 @@ class MockDefinition extends Definition {
return result;
}
@Override
public int hashCode() {
int result = super.hashCode();
result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.typeToMock);
result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.extraInterfaces);
result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.answer);
result = MULTIPLIER * result + Boolean.hashCode(this.serializable);
return result;
}
@Override
public String toString() {
return new ToStringCreator(this).append("name", getName())

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.
@@ -46,11 +46,6 @@ class MockitoContextCustomizer implements ContextCustomizer {
}
}
@Override
public int hashCode() {
return this.definitions.hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
@@ -63,4 +58,9 @@ class MockitoContextCustomizer implements ContextCustomizer {
return this.definitions.equals(other.definitions);
}
@Override
public int hashCode() {
return this.definitions.hashCode();
}
}

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.
@@ -60,11 +60,6 @@ class QualifierDefinition {
definition.setQualifiedElement(this.field);
}
@Override
public int hashCode() {
return this.annotations.hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
@@ -77,6 +72,11 @@ class QualifierDefinition {
return this.annotations.equals(other.annotations);
}
@Override
public int hashCode() {
return this.annotations.hashCode();
}
public static QualifierDefinition forElement(AnnotatedElement element) {
if (element != null && element instanceof Field) {
Field field = (Field) element;

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.
@@ -51,13 +51,6 @@ class SpyDefinition extends Definition {
return this.typeToSpy;
}
@Override
public int hashCode() {
int result = super.hashCode();
result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.typeToSpy);
return result;
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
@@ -72,6 +65,13 @@ class SpyDefinition extends Definition {
return result;
}
@Override
public int hashCode() {
int result = super.hashCode();
result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.typeToSpy);
return result;
}
@Override
public String toString() {
return new ToStringCreator(this).append("name", getName())

View File

@@ -74,11 +74,6 @@ class TestRestTemplateContextCustomizer implements ContextCustomizer {
definition);
}
@Override
public int hashCode() {
return getClass().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null || obj.getClass() != getClass()) {
@@ -87,6 +82,11 @@ class TestRestTemplateContextCustomizer implements ContextCustomizer {
return true;
}
@Override
public int hashCode() {
return getClass().hashCode();
}
/**
* {@link BeanDefinitionRegistryPostProcessor} that runs after the
* {@link ConfigurationClassPostProcessor} and add a {@link TestRestTemplateFactory}

View File

@@ -78,13 +78,13 @@ class WebTestClientContextCustomizer implements ContextCustomizer {
}
@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

@@ -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.
@@ -43,11 +43,6 @@ public class ExampleObject {
this.age = age;
}
@Override
public int hashCode() {
return 0;
}
@Override
public boolean equals(Object obj) {
if (obj == null || obj.getClass() != getClass()) {
@@ -58,6 +53,11 @@ public class ExampleObject {
&& ObjectUtils.nullSafeEquals(this.age, other.age);
}
@Override
public int hashCode() {
return 0;
}
@Override
public String toString() {
return this.name + " " + this.age;

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 ExampleObjectWithView {
this.age = age;
}
@Override
public int hashCode() {
return 0;
}
@Override
public boolean equals(Object obj) {
if (obj == null || obj.getClass() != getClass()) {
@@ -63,6 +58,11 @@ public class ExampleObjectWithView {
&& ObjectUtils.nullSafeEquals(this.age, other.age);
}
@Override
public int hashCode() {
return 0;
}
@Override
public String toString() {
return this.name + " " + this.age;