1
0
mirror of synced 2026-08-03 08:51:58 +00:00

Refactor equals method

Using the accessor method for fields instead of directly access
This commit is contained in:
Seongguk Jeong
2023-07-18 22:11:33 +09:00
committed by Josh Cummings
parent 8df8d4022e
commit bcd4dcc15c
4 changed files with 11 additions and 14 deletions
@@ -64,9 +64,8 @@ public final class SwitchUserGrantedAuthority implements GrantedAuthority {
if (this == obj) {
return true;
}
if (obj instanceof SwitchUserGrantedAuthority) {
SwitchUserGrantedAuthority swa = (SwitchUserGrantedAuthority) obj;
return this.role.equals(swa.role) && this.source.equals(swa.source);
if (obj instanceof SwitchUserGrantedAuthority swa) {
return this.role.equals(swa.getAuthority()) && this.source.equals(swa.getSource());
}
return false;
}