svn commit: r15397 - trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2008-07-28 13:33:01-0700
New Revision: 15397

Modified:
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java

Log:
Liberalize getName type checking so it can be used in debugging

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java?view=diff&rev=15397&p1=trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java&p2=trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java&r1=15396&r2=15397
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	2008-07-28 13:33:01-0700
@@ -39,6 +39,7 @@
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.EStructuralFeature;
 import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.xml.type.AnyType;
 import org.eclipse.uml2.uml.Abstraction;
 import org.eclipse.uml2.uml.Action;
 import org.eclipse.uml2.uml.ActivityPartition;
@@ -810,7 +811,8 @@
     }
 
     public String getName(Object handle) {
-        if (!(handle instanceof Element) && !(handle instanceof String)) {
+        if (!(handle instanceof EObject) // should be Element not EObject really
+                && !(handle instanceof String)) {
             throw new IllegalArgumentException();
         }
         if (handle instanceof String) {
@@ -826,7 +828,7 @@
             // no longer named.  For a transitional period we'll
             // return a String to debug can continue, but the
             // calling code should probably be fixed. - tfm 20070607
-            return ""; //$NON-NLS-1$
+            return handle.toString();
         }
 //        throw new IllegalArgumentException();
     }
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.