diff options
author | Kenn Hussey | 2012-03-22 20:18:42 +0000 |
---|---|---|
committer | Kenn Hussey | 2012-03-22 20:18:42 +0000 |
commit | a888d1254d98d0c73d9eaf79ad4e731952d09586 (patch) | |
tree | 5e44844907ebe042b38c24bf1aa5bb1732ac1a16 /plugins/org.eclipse.uml2.uml | |
parent | a96a6894bff375ff20890fedb0333ba8db328abc (diff) | |
download | org.eclipse.uml2.test-a888d1254d98d0c73d9eaf79ad4e731952d09586.tar.gz org.eclipse.uml2.test-a888d1254d98d0c73d9eaf79ad4e731952d09586.tar.xz org.eclipse.uml2.test-a888d1254d98d0c73d9eaf79ad4e731952d09586.zip |
[374878] Enforcing namespace constraint.
Diffstat (limited to 'plugins/org.eclipse.uml2.uml')
-rw-r--r-- | plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/NamedElementOperations.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/NamedElementOperations.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/NamedElementOperations.java index de56ebb2..5243660b 100644 --- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/NamedElementOperations.java +++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/NamedElementOperations.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011 IBM Corporation, CEA, and others. + * Copyright (c) 2005, 2012 IBM Corporation, CEA, and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,7 +7,7 @@ * * Contributors: * IBM - initial API and implementation - * Kenn Hussey (CEA) - 327039, 351774 + * Kenn Hussey (CEA) - 327039, 351774, 374878 * */ package org.eclipse.uml2.uml.internal.operations; @@ -361,9 +361,16 @@ public class NamedElementOperations public static Namespace getNamespace(NamedElement namedElement) { InternalEObject eInternalContainer = ((InternalEObject) namedElement) .eInternalContainer(); - return eInternalContainer instanceof Namespace - ? (Namespace) eInternalContainer - : null; + + if (eInternalContainer instanceof Namespace) { + Namespace namespace = (Namespace) eInternalContainer; + + if (namespace.getMembers().contains(namedElement)) { + return namespace; + } + } + + return null; } /** |