1
0
mirror of synced 2026-05-22 13:23:17 +00:00

Use consistent equals/hashCode/toString order

Ensure that `equals` `hashCode` and `toString` methods always appear in
the same order. This aligns with the style used in Spring Framework.

Issue gh-8945
This commit is contained in:
Phillip Webb
2020-07-29 20:03:19 -07:00
committed by Rob Winch
parent 612fb22a7f
commit ec6a4cb3f0
12 changed files with 95 additions and 111 deletions
@@ -275,14 +275,6 @@ public class AuthenticationPrincipalArgumentResolverTests {
this.property = toCopy.property;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((this.property == null) ? 0 : this.property.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
@@ -306,6 +298,14 @@ public class AuthenticationPrincipalArgumentResolverTests {
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((this.property == null) ? 0 : this.property.hashCode());
return result;
}
}
}