Only set accessibility once per message, not per delivery. Would be great to set it once per proxy creation though

This commit is contained in:
Maxim Shafirov
2011-08-22 22:14:19 +04:00
parent 83666f423b
commit 6b39f62922
2 changed files with 1 additions and 2 deletions
@@ -31,6 +31,7 @@ public final class Message {
public Message(@NotNull Topic topic, @NotNull Method listenerMethod, Object[] args) {
myTopic = topic;
listenerMethod.setAccessible(true);
myListenerMethod = listenerMethod;
myArgs = args;
}
@@ -102,8 +102,6 @@ public class MessageBusConnectionImpl implements MessageBusConnection {
try {
Method listenerMethod = message.getListenerMethod();
// Method.invoke must be faster when Method.override is set to true
listenerMethod.setAccessible(true);
if (handler == myDefaultHandler) {
myDefaultHandler.handle(listenerMethod, message.getArgs());