We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea19f82 commit de1357cCopy full SHA for de1357c
core/src/main/java/org/springframework/security/core/userdetails/User.java
@@ -179,8 +179,8 @@ private static SortedSet<GrantedAuthority> sortAuthorities(Collection<? extends
179
*/
180
@Override
181
public boolean equals(Object obj) {
182
- if (obj instanceof User) {
183
- return this.username.equals(((User) obj).username);
+ if (obj instanceof User user) {
+ return this.username.equals(user.getUsername());
184
}
185
return false;
186
0 commit comments