aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2009-11-25 17:49:17 +0000
committerArtur Signell <artur.signell@itmill.com>2009-11-25 17:49:17 +0000
commit1d89da47d29849dc41d7c5f2f68700eb5e918b8d (patch)
treeebb7c433c682784da404f90a608bf1488e527826 /src/com/vaadin
parent3de11ab062646763ce0fa1671ba35e6e7117fb24 (diff)
downloadvaadin-framework-1d89da47d29849dc41d7c5f2f68700eb5e918b8d.tar.gz
vaadin-framework-1d89da47d29849dc41d7c5f2f68700eb5e918b8d.zip
Merged changes from trunk
svn changeset:10040/svn branch:event-framework-3234
Diffstat (limited to 'src/com/vaadin')
-rw-r--r--src/com/vaadin/event/EventRouter.java12
-rw-r--r--src/com/vaadin/terminal/gwt/server/ApplicationRunnerServlet.java2
2 files changed, 10 insertions, 4 deletions
diff --git a/src/com/vaadin/event/EventRouter.java b/src/com/vaadin/event/EventRouter.java
index b12a280262..dd13445e93 100644
--- a/src/com/vaadin/event/EventRouter.java
+++ b/src/com/vaadin/event/EventRouter.java
@@ -138,13 +138,17 @@ public class EventRouter implements MethodEventSource {
public void fireEvent(EventObject event) {
// It is not necessary to send any events if there are no listeners
if (listenerList != null) {
+
+ // Make a copy of the listener list to allow listeners to be added
+ // inside listener methods. Fixes #3605.
+
// Send the event to all listeners. The listeners themselves
// will filter out unwanted events.
-
- final Iterator<ListenerMethod> i = listenerList.iterator();
- while (i.hasNext()) {
- (i.next()).receiveEvent(event);
+ final Object[] listeners = listenerList.toArray();
+ for (int i = 0; i < listeners.length; i++) {
+ ((ListenerMethod) listeners[i]).receiveEvent(event);
}
+
}
}
diff --git a/src/com/vaadin/terminal/gwt/server/ApplicationRunnerServlet.java b/src/com/vaadin/terminal/gwt/server/ApplicationRunnerServlet.java
index aeb1b50c9c..b047556371 100644
--- a/src/com/vaadin/terminal/gwt/server/ApplicationRunnerServlet.java
+++ b/src/com/vaadin/terminal/gwt/server/ApplicationRunnerServlet.java
@@ -164,6 +164,8 @@ public class ApplicationRunnerServlet extends AbstractApplicationServlet {
appClass = (Class<? extends Application>) getClass()
.getClassLoader().loadClass(
defaultPackages[i] + "." + baseName);
+ } catch (ClassNotFoundException ee) {
+ // Ignore as this is expected for many packages
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();