Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use collections addAll method #1128

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
Expand Up @@ -233,12 +233,8 @@ public Map<Class<? extends Event>, Set<RegisteredListener>> createRegisteredList
try {
Method[] publicMethods = listener.getClass().getMethods();
methods = new HashSet<Method>(publicMethods.length, Float.MAX_VALUE);
for (Method method : publicMethods) {
methods.add(method);
}
for (Method method : listener.getClass().getDeclaredMethods()) {
methods.add(method);
}
methods.addAll(Arrays.asList(publicMethods));
methods.addAll(Arrays.asList(listener.getClass().getDeclaredMethods()));
} catch (NoClassDefFoundError e) {
plugin.getLogger().severe("Plugin " + plugin.getDescription().getFullName() + " has failed to register events for " + listener.getClass() + " because " + e.getMessage() + " does not exist.");
return ret;
Expand Down