Minor cleanup

This commit is contained in:
Erik Broes 2012-01-17 19:35:28 +01:00
parent 8874b94185
commit e542942d45
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.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import java.util.logging.Level; import java.util.logging.Level;
@ -29,8 +28,6 @@ public class YamlConfiguration extends FileConfiguration {
@Override @Override
public String saveToString() { public String saveToString() {
Map<String, Object> output = new LinkedHashMap<String, Object>();
yamlOptions.setIndent(options().indent()); yamlOptions.setIndent(options().indent());
yamlOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); yamlOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
yamlRepresenter.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); yamlRepresenter.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
@ -45,6 +42,7 @@ public class YamlConfiguration extends FileConfiguration {
return header + dump; return header + dump;
} }
@SuppressWarnings("unchecked")
@Override @Override
public void loadFromString(String contents) throws InvalidConfigurationException { public void loadFromString(String contents) throws InvalidConfigurationException {
if (contents == null) { if (contents == null) {
@ -70,6 +68,7 @@ public class YamlConfiguration extends FileConfiguration {
} }
} }
@SuppressWarnings("unchecked")
protected void convertMapsToSections(Map<Object, Object> input, ConfigurationSection section) { protected void convertMapsToSections(Map<Object, Object> input, ConfigurationSection section) {
for (Map.Entry<Object, Object> entry : input.entrySet()) { for (Map.Entry<Object, Object> entry : input.entrySet()) {
String key = entry.getKey().toString(); 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); throw new YAMLException("Unexpected referential mapping structure. Node: " + node);
} }
@SuppressWarnings("unchecked")
Map<Object, Object> raw = (Map<Object, Object>) super.construct(node); Map<Object, Object> raw = (Map<Object, Object>) super.construct(node);
if (raw.containsKey(ConfigurationSerialization.SERIALIZED_TYPE_KEY)) { if (raw.containsKey(ConfigurationSerialization.SERIALIZED_TYPE_KEY)) {

View File

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

View File

@ -12,6 +12,7 @@ import org.bukkit.entity.Entity;
* <li>Snow formed by a {@link org.bukkit.entity.Snowman}.</li> * <li>Snow formed by a {@link org.bukkit.entity.Snowman}.</li>
* </ul> * </ul>
*/ */
@SuppressWarnings("serial")
public class EntityBlockFormEvent extends BlockFormEvent { public class EntityBlockFormEvent extends BlockFormEvent {
private Entity entity; private Entity entity;

View File

@ -10,6 +10,7 @@ import org.bukkit.event.HandlerList;
/** /**
* Thrown when a Living Entity creates a portal in a world. * Thrown when a Living Entity creates a portal in a world.
*/ */
@SuppressWarnings("serial")
public class EntityCreatePortalEvent extends EntityEvent implements Cancellable { public class EntityCreatePortalEvent extends EntityEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
private List<BlockState> blocks; private List<BlockState> blocks;

View File

@ -5,6 +5,7 @@ import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
@SuppressWarnings("serial")
public class ItemDespawnEvent extends EntityEvent implements Cancellable { public class ItemDespawnEvent extends EntityEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
private boolean canceled; private boolean canceled;

View File

@ -3,6 +3,7 @@ package org.bukkit.plugin.messaging;
/** /**
* Thrown if a Plugin Channel is too long. * Thrown if a Plugin Channel is too long.
*/ */
@SuppressWarnings("serial")
public class ChannelNameTooLongException extends RuntimeException { public class ChannelNameTooLongException extends RuntimeException {
public ChannelNameTooLongException() { public ChannelNameTooLongException() {
super("Attempted to send a Plugin Message to a channel that was too large. The maximum length a channel may be is " + Messenger.MAX_CHANNEL_SIZE + " chars."); super("Attempted to send a Plugin Message to a channel that was too large. The maximum length a channel may be is " + Messenger.MAX_CHANNEL_SIZE + " chars.");

View File

@ -3,6 +3,7 @@ package org.bukkit.plugin.messaging;
/** /**
* Thrown if a Plugin attempts to send a message on an unregistered channel. * Thrown if a Plugin attempts to send a message on an unregistered channel.
*/ */
@SuppressWarnings("serial")
public class ChannelNotRegisteredException extends RuntimeException { public class ChannelNotRegisteredException extends RuntimeException {
public ChannelNotRegisteredException() { public ChannelNotRegisteredException() {
this("Attempted to send a plugin message through an unregistered channel."); this("Attempted to send a plugin message through an unregistered channel.");

View File

@ -3,6 +3,7 @@ package org.bukkit.plugin.messaging;
/** /**
* Thrown if a Plugin Message is sent that is too large to be sent. * Thrown if a Plugin Message is sent that is too large to be sent.
*/ */
@SuppressWarnings("serial")
public class MessageTooLargeException extends RuntimeException { public class MessageTooLargeException extends RuntimeException {
public MessageTooLargeException() { public MessageTooLargeException() {
this("Attempted to send a plugin message that was too large. The maximum length a plugin message may be is " + Messenger.MAX_MESSAGE_SIZE + " bytes."); this("Attempted to send a plugin message that was too large. The maximum length a plugin message may be is " + Messenger.MAX_MESSAGE_SIZE + " bytes.");

View File

@ -3,6 +3,7 @@ package org.bukkit.plugin.messaging;
/** /**
* Thrown if a plugin attempts to register for a reserved channel (such as "REGISTER") * Thrown if a plugin attempts to register for a reserved channel (such as "REGISTER")
*/ */
@SuppressWarnings("serial")
public class ReservedChannelException extends RuntimeException { public class ReservedChannelException extends RuntimeException {
public ReservedChannelException() { public ReservedChannelException() {
this("Attempted to register for a reserved channel name."); this("Attempted to register for a reserved channel name.");