From 56df2477cacc029624ce711ef5934920c4952411 Mon Sep 17 00:00:00 2001 From: Luck Date: Tue, 4 Oct 2016 17:30:27 +0100 Subject: [PATCH] Fix UnsupportedOperationExceptions with #getPermissions --- .../main/java/me/lucko/luckperms/core/PermissionHolder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java b/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java index 90993f5ee..914b29728 100644 --- a/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java +++ b/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java @@ -249,7 +249,7 @@ public abstract class PermissionHolder { * @return a set of nodes */ public SortedSet getAllNodes(List excludedGroups, Contexts context) { - SortedSet all = getPermissions(true); + SortedSet all = new TreeSet<>((SortedSet) 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) getPermissions(true)); } Map contexts = new HashMap<>(context.getContext());