Fix NullPointerException when comparing AccessSections
AccessSection.permissions and Permission.rules may not be set and null
values should be handled in the equals methods.
We saw this NPE when PermissionCollection tried to sort the access
sections.
Change-Id: I6f5a0886e6f9e5498fe9d756f289c5e91ed3485e
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
(cherry picked from commit 915104def3
)
This commit is contained in:
parent
ff4c66885d
commit
121cbead32
@ -124,7 +124,7 @@ public class AccessSection extends RefConfigSection implements
|
||||
if (!super.equals(obj) || !(obj instanceof AccessSection)) {
|
||||
return false;
|
||||
}
|
||||
return new HashSet<Permission>(permissions).equals(new HashSet<Permission>(
|
||||
((AccessSection) obj).permissions));
|
||||
return new HashSet<Permission>(getPermissions()).equals(new HashSet<Permission>(
|
||||
((AccessSection) obj).getPermissions()));
|
||||
}
|
||||
}
|
||||
|
@ -241,8 +241,8 @@ public class Permission implements Comparable<Permission> {
|
||||
if (!name.equals(other.name) || exclusiveGroup != other.exclusiveGroup) {
|
||||
return false;
|
||||
}
|
||||
return new HashSet<PermissionRule>(rules)
|
||||
.equals(new HashSet<PermissionRule>(other.rules));
|
||||
return new HashSet<PermissionRule>(getRules())
|
||||
.equals(new HashSet<PermissionRule>(other.getRules()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user