svn commit: r13319 - trunk/src/model-mdr/src/org/argouml/model/mdr/CoreFactoryMDRImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-08-13 19:17:01-0700
New Revision: 13319

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

Log:
Build Generalization in child namespace, not parent, so external elements can be generalized

Modified: trunk/src/model-mdr/src/org/argouml/model/mdr/CoreFactoryMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-mdr/src/org/argouml/model/mdr/CoreFactoryMDRImpl.java?view=diff&rev=13319&p1=trunk/src/model-mdr/src/org/argouml/model/mdr/CoreFactoryMDRImpl.java&p2=trunk/src/model-mdr/src/org/argouml/model/mdr/CoreFactoryMDRImpl.java&r1=13318&r2=13319
==============================================================================
--- trunk/src/model-mdr/src/org/argouml/model/mdr/CoreFactoryMDRImpl.java	(original)
+++ trunk/src/model-mdr/src/org/argouml/model/mdr/CoreFactoryMDRImpl.java	2007-08-13 19:17:01-0700
@@ -1029,11 +1029,6 @@
             }
         }
 
-        // TODO: What well-formedness rule is this?
-        if (parent.getNamespace() == null) {
-            throw new IllegalArgumentException("parent has no namespace");
-        }
-        
         // TODO: This is well-formedness rule from UML1.4.2
         // 4.5.3.20 [2] No GeneralizableElement can have a parent
         // Generalization to an element that is a leaf.
@@ -1052,7 +1047,11 @@
         Generalization gen = createGeneralization();
         gen.setParent(parent);
         gen.setChild(child);
-        gen.setNamespace(parent.getNamespace());
+        if (child.getNamespace() != null) {
+            gen.setNamespace(child.getNamespace());
+        } else if (child instanceof Namespace) {
+            gen.setNamespace((Namespace) child);
+        }
         return gen;
     }
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.