summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordurron597 <martin.jared@gmail.com>2011-01-01 17:08:32 -0500
committerdurron597 <martin.jared@gmail.com>2011-01-01 17:08:32 -0500
commit61232549e418b42520440d4ae9e5cea5d8ea66c2 (patch)
treec88116e9ecdfd464bfcd4fa0feea16416548aebb
parent9ecdf8b4baf0cfd212ed001c3cccf8a5761c08c6 (diff)
downloadbukkit-61232549e418b42520440d4ae9e5cea5d8ea66c2.tar
bukkit-61232549e418b42520440d4ae9e5cea5d8ea66c2.tar.gz
bukkit-61232549e418b42520440d4ae9e5cea5d8ea66c2.tar.lz
bukkit-61232549e418b42520440d4ae9e5cea5d8ea66c2.tar.xz
bukkit-61232549e418b42520440d4ae9e5cea5d8ea66c2.zip
Use parametrized reflection to remove warnings
-rw-r--r--src/main/java/org/bukkit/plugin/PluginManager.java2
-rw-r--r--src/main/java/org/bukkit/plugin/SimplePluginManager.java6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/org/bukkit/plugin/PluginManager.java b/src/main/java/org/bukkit/plugin/PluginManager.java
index a2f88cb1..fcef6b89 100644
--- a/src/main/java/org/bukkit/plugin/PluginManager.java
+++ b/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<? extends PluginLoader> loader) throws IllegalArgumentException;
/**
* Checks if the given plugin is loaded and returns it when applicable
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index 08fed37f..c761f1da 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -39,14 +39,14 @@ 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<? extends PluginLoader> loader) throws IllegalArgumentException {
PluginLoader instance;
if (PluginLoader.class.isAssignableFrom(loader)) {
- Constructor constructor;
+ Constructor<? extends PluginLoader> constructor;
try {
constructor = loader.getConstructor(Server.class);
- instance = (PluginLoader) constructor.newInstance(server);
+ instance = constructor.newInstance(server);
} catch (NoSuchMethodException ex) {
throw new IllegalArgumentException(String.format("Class %s does not have a public %s(Server) constructor", loader.getName()), ex);
} catch (Exception ex) {