Generic cleanup of warnings, whitespace and style.

By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
Bukkit/Spigot
2011-12-25 16:02:30 +01:00
parent 98960fd73e
commit aaab1cba23
257 changed files with 1408 additions and 1152 deletions

View File

@@ -29,9 +29,11 @@ import org.yaml.snakeyaml.representer.Representer;
* select child nodes by delimiting node names with periods.
*
* <p>
* For example, given the following configuration file:</p>
* For example, given the following configuration file:
* </p>
*
* <pre>members:
* <pre>
* members:
* - Hollie
* - Jason
* - Bobo
@@ -44,13 +46,14 @@ import org.yaml.snakeyaml.representer.Representer;
* sturmeh:
* cool: false
* eats:
* babies: true</pre>
* babies: true
* </pre>
*
* <p>Calling code could access sturmeh's baby eating state by using
* <code>getBoolean("sturmeh.eats.babies", false)</code>. For lists, there are
* methods such as <code>getStringList</code> that will return a type safe list.
* <p>
* Calling code could access sturmeh's baby eating state by using <code>getBoolean("sturmeh.eats.babies", false)</code>. For lists, there are methods such as <code>getStringList</code> that will return a type safe list.
*
* <p>This class is currently incomplete. It is not yet possible to get a node.
* <p>
* This class is currently incomplete. It is not yet possible to get a node.
* </p>
*
* @deprecated See {@link YamlConfiguration}
@@ -163,7 +166,8 @@ public class Configuration extends ConfigurationNode {
}
yaml.dump(root, writer);
return true;
} catch (IOException e) {} finally {
} catch (IOException e) {
} finally {
try {
if (stream != null) {
stream.close();
@@ -190,6 +194,7 @@ public class Configuration extends ConfigurationNode {
/**
* This method returns an empty ConfigurationNode for using as a
* default in methods that select a node from a node list.
*
* @return The empty node.
*/
public static ConfigurationNode getEmptyNode() {

View File

@@ -40,17 +40,16 @@ public class ConfigurationNode {
Map<String, Object> map = new TreeMap<String, Object>();
Set<String> keys = node.keySet();
for( String k : keys ) {
for (String k : keys) {
Object tmp = node.get(k);
if( tmp instanceof Map<?,?> ) {
Map<String, Object> rec = recursiveBuilder((Map <String,Object>) tmp);
if (tmp instanceof Map<?, ?>) {
Map<String, Object> rec = recursiveBuilder((Map<String, Object>) tmp);
Set<String> subkeys = rec.keySet();
for( String sk : subkeys ) {
for (String sk : subkeys) {
map.put(k + "." + sk, rec.get(sk));
}
}
else {
} else {
map.put(k, tmp);
}
}