svn commit: r16230 - trunk/src/argouml-app/src/org/argouml/ocl/OCLEvaluator.java

Tom Morris <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2008-12-03 12:35:29-0800
New Revision: 16230

Modified:
   trunk/src/argouml-app/src/org/argouml/ocl/OCLEvaluator.java

Log:
Try harder to use Model subsystem's name method

Modified: trunk/src/argouml-app/src/org/argouml/ocl/OCLEvaluator.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ocl/OCLEvaluator.java?view=diff&pathrev=16230&r1=16229&r2=16230
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ocl/OCLEvaluator.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/ocl/OCLEvaluator.java	2008-12-03 12:35:29-0800
@@ -106,19 +106,17 @@
     }
 
     private String value2String(Object v) {
-        if (Model.getFacade().isAModelElement(v)) {
-            v = Model.getFacade().getName(v);
-            if ("".equals(v)) {
-                v = Translator.localize("misc.name.anon");
-            }
-        }
         if (Model.getFacade().isAExpression(v)) {
             v = Model.getFacade().getBody(v);
             if ("".equals(v)) {
                 v = "(unspecified)";
             }
-        }
-        if (v instanceof Collection) {
+        } else if (Model.getFacade().isAUMLElement(v)) {
+            v = Model.getFacade().getName(v);
+            if ("".equals(v)) {
+                v = Translator.localize("misc.name.anon");
+            }
+        } else if (v instanceof Collection) {
             String acc = "[";
             Collection collection = (Collection) v;
 
@@ -128,6 +126,6 @@
             acc += "]";
             v = acc;
         }
-        return ""+v;
+        return "" + v;
     }
 }  // end of OCLEvaluator

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

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.