Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made ConfigurationNode.getAll() more maintainable. Thanks devinsba!

  • Loading branch information...
commit b268859bf3543f5070e1d7c3c5ef7a27b871d180 1 parent 81a3157
@EvilSeph EvilSeph authored
Showing with 1 addition and 20 deletions.
  1. +1 −20 src/main/java/org/bukkit/util/config/ConfigurationNode.java
View
21 src/main/java/org/bukkit/util/config/ConfigurationNode.java
@@ -24,27 +24,8 @@ protected ConfigurationNode(Map<String, Object> root) {
*
* @return A map of key value pairs with the path as the key and the object as the value
*/
- @SuppressWarnings("unchecked")
public Map<String, Object> getAll() {
- Map<String, Object> map = new TreeMap<String, Object>();
-
- Set<String> keys = root.keySet();
- for( String k : keys ) {
- Object tmp = root.get(k);
- if( tmp instanceof Map<?,?> ) {
- Map<String, Object> rec = recursiveBuilder((Map <String,Object>) tmp);
-
- Set<String> subkeys = rec.keySet();
- for( String sk : subkeys ) {
- map.put(k + "." + sk, rec.get(sk));
- }
- }
- else {
- map.put(k, tmp);
- }
- }
-
- return map;
+ return recursiveBuilder(root);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.