Author: bobtarling
Date: 2010-09-13 09:48:55-0700
New Revision: 18736
Modified:
trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java
Log:
Issue 6144 allow any package to be selectable for a classifier
Modified: trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java?view=diff&pathrev=18736&r1=18735&r2=18736
==============================================================================
--- trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java (original)
+++ trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java 2010-09-13 09:48:55-0700
@@ -1445,11 +1445,13 @@
if (!isValidNamespace((StructuralFeature) modelElement, ns)) {
return false;
}
- } else if (modelElement instanceof GeneralizableElement) {
- GeneralizableElement ge = (GeneralizableElement) modelElement;
- if (!isValidNamespace(ge, ns)) {
- return false;
- }
+ // TODO: Issue 6144. It is proposed to allow any paclage to return as a potential
+ // namespace. Commenting out until this is reviewed and clearly accepted by all.
+// } else if (modelElement instanceof GeneralizableElement) {
+// GeneralizableElement ge = (GeneralizableElement) modelElement;
+// if (!isValidNamespace(ge, ns)) {
+// return false;
+// }
} else if (modelElement instanceof Generalization) {
if (!isValidNamespace((Generalization) modelElement, ns)) {
return false;
@@ -1688,27 +1690,30 @@
* self.generalization->forAll(g |
* self.namespace.allContents->includes(g.parent) )
*/
- private boolean isValidNamespace(
- GeneralizableElement generalizableElement,
- Namespace namespace) {
-
- Collection<Generalization> generalizations =
- generalizableElement.getGeneralization();
-
- ModelManagementHelperMDRImpl modelManagementHelper =
- (ModelManagementHelperMDRImpl) modelImpl.getModelManagementHelper();
-
- for (Generalization generalization : generalizations) {
- final GeneralizableElement parent = generalization.getParent();
- final Set<ModelElement> results = new HashSet<ModelElement>(2000);
- final Set<ModelElement> dupCheck = new HashSet<ModelElement>(2000);
- modelManagementHelper.getAllContents(results, namespace, dupCheck);
- if (!results.contains(parent)) {
- return false;
- }
- }
- return true;
- }
+// TODO: Issue 6144. It is proposed to allow any paclage to return as a potential
+// namespace. Commenting out until this is reviewed and clearly accepted by all.
+
+// private boolean isValidNamespace(
+// GeneralizableElement generalizableElement,
+// Namespace namespace) {
+//
+// Collection<Generalization> generalizations =
+// generalizableElement.getGeneralization();
+//
+// ModelManagementHelperMDRImpl modelManagementHelper =
+// (ModelManagementHelperMDRImpl) modelImpl.getModelManagementHelper();
+//
+// for (Generalization generalization : generalizations) {
+// final GeneralizableElement parent = generalization.getParent();
+// final Set<ModelElement> results = new HashSet<ModelElement>(2000);
+// final Set<ModelElement> dupCheck = new HashSet<ModelElement>(2000);
+// modelManagementHelper.getAllContents(results, namespace, dupCheck);
+// if (!results.contains(parent)) {
+// return false;
+// }
+// }
+// return true;
+// }
public Namespace getFirstSharedNamespace(Object ns1, Object ns2) {
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2658805
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.