diff options
Diffstat (limited to 'server/src/main/java/com/vaadin/event/EventRouter.java')
-rw-r--r-- | server/src/main/java/com/vaadin/event/EventRouter.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/server/src/main/java/com/vaadin/event/EventRouter.java b/server/src/main/java/com/vaadin/event/EventRouter.java index f5c04b2de1..59599a0aac 100644 --- a/server/src/main/java/com/vaadin/event/EventRouter.java +++ b/server/src/main/java/com/vaadin/event/EventRouter.java @@ -132,9 +132,9 @@ public class EventRouter implements MethodEventSource { // Find the correct method final Method[] methods = target.getClass().getMethods(); Method method = null; - for (int i = 0; i < methods.length; i++) { - if (methods[i].getName().equals(methodName)) { - method = methods[i]; + for (Method m : methods) { + if (m.getName().equals(methodName)) { + method = m; } } if (method == null) { @@ -197,9 +197,8 @@ public class EventRouter implements MethodEventSource { // Send the event to all listeners. The listeners themselves // will filter out unwanted events. - final Object[] listeners = listenerList.toArray(); - for (int i = 0; i < listeners.length; i++) { - ListenerMethod listenerMethod = (ListenerMethod) listeners[i]; + for (Object l : listenerList.toArray()) { + ListenerMethod listenerMethod = (ListenerMethod) l; if (null != errorHandler) { try { listenerMethod.receiveEvent(event); |