Minor cleanup

By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
Bukkit/Spigot
2012-01-17 19:35:28 +01:00
parent 85c66fd6f3
commit 33f366c08d
10 changed files with 10 additions and 5 deletions

View File

@@ -4,7 +4,6 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.logging.Level;
@@ -29,8 +28,6 @@ public class YamlConfiguration extends FileConfiguration {
@Override
public String saveToString() {
Map<String, Object> output = new LinkedHashMap<String, Object>();
yamlOptions.setIndent(options().indent());
yamlOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
yamlRepresenter.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
@@ -45,6 +42,7 @@ public class YamlConfiguration extends FileConfiguration {
return header + dump;
}
@SuppressWarnings("unchecked")
@Override
public void loadFromString(String contents) throws InvalidConfigurationException {
if (contents == null) {
@@ -70,6 +68,7 @@ public class YamlConfiguration extends FileConfiguration {
}
}
@SuppressWarnings("unchecked")
protected void convertMapsToSections(Map<Object, Object> input, ConfigurationSection section) {
for (Map.Entry<Object, Object> entry : input.entrySet()) {
String key = entry.getKey().toString();

View File

@@ -23,6 +23,7 @@ public class YamlConstructor extends SafeConstructor {
throw new YAMLException("Unexpected referential mapping structure. Node: " + node);
}
@SuppressWarnings("unchecked")
Map<Object, Object> raw = (Map<Object, Object>) super.construct(node);
if (raw.containsKey(ConfigurationSerialization.SERIALIZED_TYPE_KEY)) {

View File

@@ -19,7 +19,6 @@ public class YamlRepresenter extends Representer {
private class RepresentConfigurationSection extends RepresentMap {
@Override
@SuppressWarnings("unchecked")
public Node representData(Object data) {
return super.representData(((ConfigurationSection) data).getValues(false));
}
@@ -27,7 +26,6 @@ public class YamlRepresenter extends Representer {
private class RepresentConfigurationSerializable extends RepresentMap {
@Override
@SuppressWarnings("unchecked")
public Node representData(Object data) {
ConfigurationSerializable serializable = (ConfigurationSerializable) data;
Map<String, Object> values = new LinkedHashMap<String, Object>();