svn commit: r18772 - trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SimpleListModel.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2010-09-20 11:42:21-0700
New Revision: 18772

Modified:
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SimpleListModel.java

Log:
Check instanceof raher than equality when testing model element type

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SimpleListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SimpleListModel.java?view=diff&pathrev=18772&r1=18771&r2=18772
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SimpleListModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SimpleListModel.java	2010-09-20 11:42:21-0700
@@ -124,7 +124,13 @@
         	                removeElement(objectToRemove);
         	            } else if (e instanceof AddAssociationEvent) {
         	                Object newElement = ((AddAssociationEvent) e).getChangedValue();
-        	                if (metaTypes.contains(newElement.getClass())
+                                boolean typeValid = false;
+                                for (Class<?> cls : metaTypes) {
+                                    if (cls.isInstance(newElement)) {
+                                	typeValid = true;
+                                    }
+                                }
+        	                if (typeValid
         	                        && !SimpleListModel.this.contains(newElement)) {
         		            if (Model.getUmlHelper().isMovable(getMetaType())) {
         		                final Collection c =

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2662432

To unsubscribe from this discussion, e-mail: [[email protected]].
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.