Fix UnsupportedOperationExceptions with #getPermissions

This commit is contained in:
Luck 2016-10-04 17:30:27 +01:00
parent 9b4384dc33
commit 56df2477ca
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -249,7 +249,7 @@ public abstract class PermissionHolder {
* @return a set of nodes
*/
public SortedSet<LocalizedNode> getAllNodes(List<String> excludedGroups, Contexts context) {
SortedSet<LocalizedNode> all = getPermissions(true);
SortedSet<LocalizedNode> all = new TreeSet<>((SortedSet<LocalizedNode>) getPermissions(true));
if (excludedGroups == null) {
excludedGroups = new ArrayList<>();
@ -310,7 +310,7 @@ public abstract class PermissionHolder {
if (context.isApplyGroups()) {
allNodes = getAllNodes(null, context);
} else {
allNodes = getPermissions(true);
allNodes = new TreeSet<>((SortedSet<LocalizedNode>) getPermissions(true));
}
Map<String, String> contexts = new HashMap<>(context.getContext());