From 9013f5981531bb65ff138b12b1854ad70eed6007 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 2 Jan 2011 00:26:04 -0600 Subject: [PATCH 1/3] Added generics to PluginManager By: Lymia --- paper-api/src/main/java/org/bukkit/plugin/PluginManager.java | 2 +- .../src/main/java/org/bukkit/plugin/SimplePluginManager.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/plugin/PluginManager.java b/paper-api/src/main/java/org/bukkit/plugin/PluginManager.java index a2f88cb177..1f22efd4e0 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/PluginManager.java +++ b/paper-api/src/main/java/org/bukkit/plugin/PluginManager.java @@ -18,7 +18,7 @@ public interface PluginManager { * @param loader Class name of the PluginLoader to register * @throws IllegalArgumentException Thrown when the given Class is not a valid PluginLoader */ - public void RegisterInterface(Class loader) throws IllegalArgumentException; + public void RegisterInterface(Class loader) throws IllegalArgumentException; /** * Checks if the given plugin is loaded and returns it when applicable diff --git a/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java index 08fed37f5f..ed17147976 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -39,11 +39,11 @@ public final class SimplePluginManager implements PluginManager { * @param loader Class name of the PluginLoader to register * @throws IllegalArgumentException Thrown when the given Class is not a valid PluginLoader */ - public void RegisterInterface(Class loader) throws IllegalArgumentException { + public void RegisterInterface(Class loader) throws IllegalArgumentException { PluginLoader instance; if (PluginLoader.class.isAssignableFrom(loader)) { - Constructor constructor; + Constructor constructor; try { constructor = loader.getConstructor(Server.class); instance = (PluginLoader) constructor.newInstance(server); From 51005cf1bea238414e96b3cfef87d4c36012f2f4 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 2 Jan 2011 00:29:34 -0600 Subject: [PATCH 2/3] Opps! Wrong class. By: Lymia --- paper-api/src/main/java/org/bukkit/plugin/PluginManager.java | 2 +- .../src/main/java/org/bukkit/plugin/SimplePluginManager.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/plugin/PluginManager.java b/paper-api/src/main/java/org/bukkit/plugin/PluginManager.java index 1f22efd4e0..fcef6b8941 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/PluginManager.java +++ b/paper-api/src/main/java/org/bukkit/plugin/PluginManager.java @@ -18,7 +18,7 @@ public interface PluginManager { * @param loader Class name of the PluginLoader to register * @throws IllegalArgumentException Thrown when the given Class is not a valid PluginLoader */ - public void RegisterInterface(Class loader) throws IllegalArgumentException; + public void RegisterInterface(Class loader) throws IllegalArgumentException; /** * Checks if the given plugin is loaded and returns it when applicable diff --git a/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java index ed17147976..64eab97bec 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -39,11 +39,11 @@ public final class SimplePluginManager implements PluginManager { * @param loader Class name of the PluginLoader to register * @throws IllegalArgumentException Thrown when the given Class is not a valid PluginLoader */ - public void RegisterInterface(Class loader) throws IllegalArgumentException { + public void RegisterInterface(Class loader) throws IllegalArgumentException { PluginLoader instance; if (PluginLoader.class.isAssignableFrom(loader)) { - Constructor constructor; + Constructor constructor; try { constructor = loader.getConstructor(Server.class); instance = (PluginLoader) constructor.newInstance(server); From 4937cffabbde157aae7542512e455775f0e7582b Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 2 Jan 2011 00:38:51 -0600 Subject: [PATCH 3/3] Fixed generics warning. By: Lymia --- .../main/java/org/bukkit/plugin/PluginDescriptionFile.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paper-api/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java b/paper-api/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java index 9387d253a8..78f54281ac 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java +++ b/paper-api/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java @@ -17,6 +17,7 @@ public final class PluginDescriptionFile { private String name = null; private String main = null; + @SuppressWarnings("unchecked") public PluginDescriptionFile(final InputStream stream) throws InvalidDescriptionException { try { loadMap((Map)yaml.load(stream)); @@ -29,10 +30,11 @@ public final class PluginDescriptionFile { * Loads a PluginDescriptionFile from the specified reader * @param reader */ + @SuppressWarnings("unchecked") public PluginDescriptionFile(final Reader reader) { loadMap((Map)yaml.load(reader)); } - + /** * Creates a new PluginDescriptionFile with the given detailed *