From 6eb7e7a55829c2ea6fb3575ca1135815e78357c3 Mon Sep 17 00:00:00 2001 From: Corey Shupe Date: Wed, 21 Feb 2018 21:02:23 -0500 Subject: [PATCH] Fixed top level permission addition. Bug where only the last known addition to the permission map would actually be added, moved map declaration outside of nested for loop and put the permissible setting outside as well to stop ridiculous amounts of calls to it. --- .../factions/util/PermissionsMapTypeAdapter.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/util/PermissionsMapTypeAdapter.java b/src/main/java/com/massivecraft/factions/util/PermissionsMapTypeAdapter.java index 69fdd79f..0bcb6965 100644 --- a/src/main/java/com/massivecraft/factions/util/PermissionsMapTypeAdapter.java +++ b/src/main/java/com/massivecraft/factions/util/PermissionsMapTypeAdapter.java @@ -34,16 +34,15 @@ public class PermissionsMapTypeAdapter implements JsonDeserializer access + Map accessMap = new HashMap<>(); for (Map.Entry entry2 : entry.getValue().getAsJsonObject().entrySet()) { - Map accessMap = new HashMap<>(); PermissableAction permissableAction = PermissableAction.fromString(entry2.getKey()); Access access = Access.fromString(entry2.getValue().getAsString()); accessMap.put(permissableAction, access); - - permissionsMap.put(permissable, accessMap); } + permissionsMap.put(permissable, accessMap); } return permissionsMap;