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

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2007-07-27 23:30:44-0700
New Revision: 13173

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

Log:
Fix the exception for non-package namespaces. 

Make the sequence2 diagram compile.

Modified: trunk/src/model-mdr/src/org/argouml/model/mdr/CollaborationsHelperMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-mdr/src/org/argouml/model/mdr/CollaborationsHelperMDRImpl.java?view=diff&rev=13173&p1=trunk/src/model-mdr/src/org/argouml/model/mdr/CollaborationsHelperMDRImpl.java&p2=trunk/src/model-mdr/src/org/argouml/model/mdr/CollaborationsHelperMDRImpl.java&r1=13172&r2=13173
==============================================================================
--- trunk/src/model-mdr/src/org/argouml/model/mdr/CollaborationsHelperMDRImpl.java	(original)
+++ trunk/src/model-mdr/src/org/argouml/model/mdr/CollaborationsHelperMDRImpl.java	2007-07-27 23:30:44-0700
@@ -594,9 +594,17 @@
          * If not - find its parent package! 
          * Currently this causes an exception when creating 
          * a sequence diagram for a ClassifierRole.*/
+        if (!modelImpl.getFacade().isAPackage(ns)) {
+            while (modelImpl.getFacade().isANamespace(ns)) {
+                ns = ns.getNamespace();
+                if (modelImpl.getFacade().isAPackage(ns)) break;
+            }
+        }
         // now get all classifiers imported from other packages
-        returnList.addAll(getAllImportedClassifiers(ns));
-        
+        if (modelImpl.getFacade().isAPackage(ns)) {
+            returnList.addAll(getAllImportedClassifiers(ns));
+        }
+
         return returnList;
     }
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.