svn commit: r16797 - 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-15 07:30:41-0800
New Revision: 16797

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

Log:
Issue 5691, 5692 and 56932 require the added flexability required by this. If the activator is changed then we adapt the model for correctness rather than throw an exception and restrict. 

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=16797&r1=16796&r2=16797
==============================================================================
--- 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-15 07:30:41-0800
@@ -267,12 +267,6 @@
                                 + "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 "
-                        + "may not contain the " + "activator");
-            }
             // we must find out if the activator itself does not have
             // message as it's activator
             if (hasAsActivator(activator, mes)) {
@@ -281,12 +275,10 @@
                                 + "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);
-//            }
+            // An activator can't also be a predecessor of a message
+            if (mes.getPredecessor().contains(activator)) {
+                mes.getPredecessor().remove(activator);
+            }
         }
         List<Message> listToChange = new ArrayList<Message>();
         Collection<Message> predecessors = mes.getPredecessor();

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

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.