mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-24 18:09:41 -05:00
Added a few null pointer checks and performed minor touchups (tried improving a few equals, clone and hashCode methods).
By: VictorD <victor.danell@gmail.com>
This commit is contained in:
1 parent
5673661da0
commit
bb755bb9a2
9 files changed
+51
-16
No files matched your search
@@ -53,7 +53,7 @@ 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<? extends PluginLoader> loader) throws IllegalArgumentException {
|
||||
public void registerInterface(Class<? extends PluginLoader> loader) throws IllegalArgumentException {
|
||||
PluginLoader instance;
|
||||
|
||||
if (PluginLoader.class.isAssignableFrom(loader)) {
|
||||
@@ -62,7 +62,8 @@ public final class SimplePluginManager implements PluginManager {
|
||||
constructor = loader.getConstructor(Server.class);
|
||||
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);
|
||||
String className = loader.getName();
|
||||
throw new IllegalArgumentException(String.format("Class %s does not have a public %s(Server) constructor", className,className), ex);
|
||||
} catch (Exception ex) {
|
||||
throw new IllegalArgumentException(String.format("Unexpected exception %s while attempting to construct a new instance of %s", ex.getClass().getName(), loader.getName()), ex);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user