diff options
Diffstat (limited to 'platform/util/src/com/intellij/util/EventDispatcher.java')
-rw-r--r-- | platform/util/src/com/intellij/util/EventDispatcher.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/platform/util/src/com/intellij/util/EventDispatcher.java b/platform/util/src/com/intellij/util/EventDispatcher.java index 34361a8ff31b..e17c6e46e5f3 100644 --- a/platform/util/src/com/intellij/util/EventDispatcher.java +++ b/platform/util/src/com/intellij/util/EventDispatcher.java @@ -43,6 +43,7 @@ public class EventDispatcher<T extends EventListener> { } private EventDispatcher(@NotNull Class<T> listenerClass) { + LOG.assertTrue(listenerClass.isInterface(), "listenerClass must be an interface"); InvocationHandler handler = new InvocationHandler() { @Override @NonNls @@ -71,10 +72,7 @@ public class EventDispatcher<T extends EventListener> { }; //noinspection unchecked - myMulticaster = (T)Proxy.newProxyInstance(listenerClass.getClassLoader(), - new Class[]{listenerClass}, - handler - ); + myMulticaster = (T)Proxy.newProxyInstance(listenerClass.getClassLoader(), new Class[]{listenerClass}, handler); } @NotNull @@ -82,7 +80,7 @@ public class EventDispatcher<T extends EventListener> { return myMulticaster; } - private void dispatch(final Method method, final Object[] args) { + private void dispatch(@NotNull Method method, Object[] args) { method.setAccessible(true); for (T listener : myListeners) { |