1
0
mirror of synced 2026-07-05 02:40:02 +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
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2023 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.
@@ -113,14 +113,13 @@ public class LdapAuthority implements GrantedAuthority {
if (this == obj) {
return true;
}
if (!(obj instanceof LdapAuthority)) {
if (!(obj instanceof LdapAuthority other)) {
return false;
}
LdapAuthority other = (LdapAuthority) obj;
if (!this.dn.equals(other.dn)) {
if (!this.dn.equals(other.getDn())) {
return false;
}
return this.role.equals(other.role);
return this.role.equals(other.getAuthority());
}
@Override