svn commit: r15097 - trunk/src/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2008-06-28 07:08:03-0700
New Revision: 15097

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java

Log:
Issue 5182: Ignore duplicate requests to setTarget

Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java?view=diff&rev=15097&p1=trunk/src/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java&p2=trunk/src/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java&r1=15096&r2=15097
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java	2008-06-28 07:08:03-0700
@@ -343,6 +343,10 @@
      * @param theNewTarget the target
      */
     public void setTarget(Object theNewTarget) {
+        if (theNewTarget != null && theNewTarget.equals(comboBoxTarget)) {
+            LOG.debug("Ignoring duplicate setTarget request " + theNewTarget);
+            return;
+        }
         LOG.debug("setTarget target :  " + theNewTarget);
         theNewTarget = theNewTarget instanceof Fig 
             ? ((Fig) theNewTarget).getOwner() : theNewTarget;
@@ -465,6 +469,7 @@
      * @param o the element to be added
      */
     public void addElement(Object o) {
+        // TODO: For large lists, this is doing a linear search of literally thousands of elements
         if (!objects.contains(o)) {
             objects.add(o);
             fireIntervalAdded(this, objects.size() - 1, objects.size() - 1);
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.