Refactor equals method
Using the accessor method for fields instead of directly access
This commit is contained in:
committed by
Josh Cummings
parent
8df8d4022e
commit
bcd4dcc15c
+2
-3
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user