If a listener throws an exception, log it but continue to deliver the event to other listeners. ddbean_removal_root java_tasklist_89600_root nb-vw-integration_b_merge1 nb-vw-integration_base versionability_89629_base_1
authorjglick@netbeans.org
Mon, 26 Mar 2007 22:24:10 +0000
changeset 265576b1ae1f101
parent 264 21e3ab463aa7
child 266 bd5cfb5c685e
If a listener throws an exception, log it but continue to deliver the event to other listeners.
openide.util/src/org/openide/util/ChangeSupport.java
     1.1 --- a/openide.util/src/org/openide/util/ChangeSupport.java	Mon Mar 26 20:59:06 2007 +0000
     1.2 +++ b/openide.util/src/org/openide/util/ChangeSupport.java	Mon Mar 26 22:24:10 2007 +0000
     1.3 @@ -97,7 +97,11 @@
     1.4      private void fireChange(ChangeEvent event) {
     1.5          assert event != null;
     1.6          for (ChangeListener listener : listeners) {
     1.7 -            listener.stateChanged(event);
     1.8 +            try {
     1.9 +                listener.stateChanged(event);
    1.10 +            } catch (RuntimeException x) {
    1.11 +                Exceptions.printStackTrace(x);
    1.12 +            }
    1.13          }
    1.14      }
    1.15