From 0c05778bc3d0f3152c15ffe8f1fbe4eabe86a608 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 14 Jul 2011 14:41:55 -0400 Subject: [PATCH] Made ConfigurationNode.getAll() more maintainable. Thanks devinsba! By: EvilSeph --- .../bukkit/util/config/ConfigurationNode.java | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/util/config/ConfigurationNode.java b/paper-api/src/main/java/org/bukkit/util/config/ConfigurationNode.java index 583d35b6c2..77dad4d37c 100644 --- a/paper-api/src/main/java/org/bukkit/util/config/ConfigurationNode.java +++ b/paper-api/src/main/java/org/bukkit/util/config/ConfigurationNode.java @@ -24,27 +24,8 @@ public class ConfigurationNode { * * @return A map of key value pairs with the path as the key and the object as the value */ - @SuppressWarnings("unchecked") public Map getAll() { - Map map = new TreeMap(); - - Set keys = root.keySet(); - for( String k : keys ) { - Object tmp = root.get(k); - if( tmp instanceof Map ) { - Map rec = recursiveBuilder((Map ) tmp); - - Set subkeys = rec.keySet(); - for( String sk : subkeys ) { - map.put(k + "." + sk, rec.get(sk)); - } - } - else { - map.put(k, tmp); - } - } - - return map; + return recursiveBuilder(root); } /**