svn commit: r18444 - trunk/src/argouml-app: src/org/argouml/notation/providers/uml tests/org/argouml/notation/providers/uml

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2010-06-11 14:28:57-0700
New Revision: 18444

Modified:
   trunk/src/argouml-app/src/org/argouml/notation/providers/uml/TransitionNotationUml.java
   trunk/src/argouml-app/tests/org/argouml/notation/providers/uml/TestTransitionNotationUml.java

Log:
Correction on fix for issue 5983: Problem with directly typed in event[guard]/action when action has [].
Now the unit tests work, except one - to be further investigated.

Modified: trunk/src/argouml-app/src/org/argouml/notation/providers/uml/TransitionNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/notation/providers/uml/TransitionNotationUml.java?view=diff&pathrev=18444&r1=18443&r2=18444
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/notation/providers/uml/TransitionNotationUml.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/notation/providers/uml/TransitionNotationUml.java	2010-06-11 14:28:57-0700
@@ -142,17 +142,21 @@
         String eg = s1[0].trim();
         String[] s2 = eg.split("\\[", 2);
         
-        if (s1[1].trim().length() > 0) {
-            parseEffect(trans, s1[1].trim()); 
+        if (s1.length > 1)  {
+            if (s1[1].trim().length() > 0) {
+                parseEffect(trans, s1[1].trim()); 
+            }
         }
         if (s2[0].trim().length() > 0) {
             parseTrigger(trans, s2[0].trim());
         }
-        if (s2[1].trim().endsWith("]")) {
-            String g = s2[1].trim();
-            g = g.substring(0, g.length() - 1).trim();
-            if (g.length() > 0) {
-                parseGuard(trans, g);
+        if (s2.length > 1)  {
+            if (s2[1].trim().endsWith("]")) {
+                String g = s2[1].trim();
+                g = g.substring(0, g.length() - 1).trim();
+                if (g.length() > 0) {
+                    parseGuard(trans, g);
+                }
             }
         }
         return trans;

Modified: trunk/src/argouml-app/tests/org/argouml/notation/providers/uml/TestTransitionNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/tests/org/argouml/notation/providers/uml/TestTransitionNotationUml.java?view=diff&pathrev=18444&r1=18443&r2=18444
==============================================================================
--- trunk/src/argouml-app/tests/org/argouml/notation/providers/uml/TestTransitionNotationUml.java	(original)
+++ trunk/src/argouml-app/tests/org/argouml/notation/providers/uml/TestTransitionNotationUml.java	2010-06-11 14:28:57-0700
@@ -203,6 +203,9 @@
         checkGenerateRoundTrip(aState, "t(a : int = 3, b : double = 4.0)");
         checkGenerateRoundTrip(aState, " / effect(a:2,r=6)");
         checkGenerateRoundTrip(aState, "trigger [guard] / eff1; eff2; eff3");
+        /* Issue 5983: */
+        checkGenerateRoundTrip(aState, "ev1 [i==1] / printf(\"got [i==1\");");
+        checkGenerateRoundTrip(aState, "ev1 [i==1] / printf(\"got [i==1]\");");
     }
 
     private void checkGenerateRoundTrip(Object st, String text) {

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

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.