13
0
geforkt von Mirrors/Paper

Added generics to PluginManager

By: Lymia <lymiahugs@gmail.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2011-01-02 00:26:04 -06:00
Ursprung 7e52bfafa3
Commit 9013f59815
2 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -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 ClassLoader> loader) throws IllegalArgumentException;
/**
* Checks if the given plugin is loaded and returns it when applicable

Datei anzeigen

@ -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<? extends ClassLoader> loader) throws IllegalArgumentException {
PluginLoader instance;
if (PluginLoader.class.isAssignableFrom(loader)) {
Constructor constructor;
Constructor<? extends ClassLoader> constructor;
try {
constructor = loader.getConstructor(Server.class);
instance = (PluginLoader) constructor.newInstance(server);