svn commit: r16777 - trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CollaborationsHelperMDRImpl.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-02-09 18:22:30-0800
New Revision: 16777

Modified:
   trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CollaborationsHelperMDRImpl.java

Log:
No change. Just commenting findings on what's happening with message activators.

Modified: trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CollaborationsHelperMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CollaborationsHelperMDRImpl.java?view=diff&pathrev=16777&r1=16776&r2=16777
==============================================================================
--- trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CollaborationsHelperMDRImpl.java	(original)
+++ trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CollaborationsHelperMDRImpl.java	2009-02-09 18:22:30-0800
@@ -250,7 +250,8 @@
             throw new IllegalArgumentException("message");
         }
         if (anactivator != null && !(anactivator instanceof Message)) {
-            throw new IllegalArgumentException("activator");
+            throw new IllegalArgumentException(
+                    "An activator must be a message");
         }
         Message mes = (Message) ames;
         Message activator = (Message) anactivator;
@@ -266,6 +267,7 @@
                                 + "of message should equal "
                                 + "interaction of activator");
             }
+            // TODO Replace this block and uncomment block below.
             if (mes.getPredecessor().contains(activator)) {
                 throw new IllegalArgumentException("In setActivator: the "
                         + "predecessors of the message "
@@ -279,6 +281,12 @@
                                 + "not be the activator for "
                                 + "the original activator");
             }
+            // TODO Replace commented block above with this
+            // Rather throw an exception we mutate the model to achieve
+            // what we want.
+//            if (mes.getPredecessor().contains(activator)) {
+//                mes.getPredecessor().remove(activator);
+//            }
         }
         List<Message> listToChange = new ArrayList<Message>();
         Collection<Message> predecessors = mes.getPredecessor();
@@ -290,6 +298,12 @@
                 listToChange.add(mes2);
             }
         }
+        // This causes problems. It can make multiple return messages
+        // refer to the same activator even if not returning to the same
+        // classifier role as the activator emenates from.
+        // I'm not sure that changing the activator of one message
+        // should amend any other messages but this is certainly changing
+        // too many - Bob.
         for (Message mes2 : listToChange) {
             mes2.setActivator(activator);
         }

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

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.