svn commit: r13760 - trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-11-11 17:00:57-0800
New Revision: 13760

Modified:
   trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java

Log:
Issue 4760 - Return equality for objects which are equal so that invalid candidates get removed correctly

Modified: trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java?view=diff&rev=13760&p1=trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java&p2=trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java&r1=13759&r2=13760
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java	(original)
+++ trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java	2007-11-11 17:00:57-0800
@@ -103,8 +103,12 @@
                             name2 = (name2 != null ? name2 : "");
                             int result = name1.compareTo(name2);
                             if (result == 0) {
-                                // Never eliminate anything
-                                return 1;
+                                // Don't return equals based on name only
+                                if (o1.equals(o2)) {
+                                    return 0;
+                                } else {
+                                    return 1;
+                                }
                             } else {
                                 return result;
                             }
@@ -132,7 +136,9 @@
                 notValids.add(tagDef);
             }
         }
+        int size = availableTagDefs.size();
         availableTagDefs.removeAll(notValids);
+        int delta = size - availableTagDefs.size();
         return availableTagDefs;
     }
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.