svn commit: r13817 - trunk/src_new/org/argouml/notation/NotationProvider.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-11-22 23:10:23-0800
New Revision: 13817

Modified:
   trunk/src_new/org/argouml/notation/NotationProvider.java

Log:
Log duplicate event listener registrations

Modified: trunk/src_new/org/argouml/notation/NotationProvider.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/notation/NotationProvider.java?view=diff&rev=13817&p1=trunk/src_new/org/argouml/notation/NotationProvider.java&p2=trunk/src_new/org/argouml/notation/NotationProvider.java&r1=13816&r2=13817
==============================================================================
--- trunk/src_new/org/argouml/notation/NotationProvider.java	(original)
+++ trunk/src_new/org/argouml/notation/NotationProvider.java	2007-11-22 23:10:23-0800
@@ -195,8 +195,14 @@
             LOG.warn("Encountered deleted object during delete of " + element);
             return;
         }
-        listeners.add(new Object[] {element, null});
-        Model.getPump().addModelEventListener(listener, element);
+        Object[] entry = new Object[] {element, null};
+        if (!listeners.contains(entry)) {
+            listeners.add(entry);
+            Model.getPump().addModelEventListener(listener, element);
+        } else {
+            LOG.warn("Attempted duplicate registration of event listener"
+                    + " - Element: " + element + " Listener: " + listener);
+        }
     }
     
     /*
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.