Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkhussey2006-05-23 17:32:16 +0000
committerkhussey2006-05-23 17:32:16 +0000
commit7231c575a8c6618c424e7e3b5a0ceca6645e2cd7 (patch)
treee231348a16a0ab0e2296b8db86f6be6e4175f838
parentb0849a376a278f8a8e399fea642966326f8421e8 (diff)
downloadorg.eclipse.uml2.test-7231c575a8c6618c424e7e3b5a0ceca6645e2cd7.tar.gz
org.eclipse.uml2.test-7231c575a8c6618c424e7e3b5a0ceca6645e2cd7.tar.xz
org.eclipse.uml2.test-7231c575a8c6618c424e7e3b5a0ceca6645e2cd7.zip
[142768] Fixing issues with finding profile applications in an ownership hierarchy.
-rw-r--r--plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/NamedElementOperations.java11
-rw-r--r--plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/PackageOperations.java20
2 files changed, 15 insertions, 16 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 8fa80228..d5045d68 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
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: NamedElementOperations.java,v 1.16 2006/05/09 17:53:38 khussey Exp $
+ * $Id: NamedElementOperations.java,v 1.17 2006/05/23 17:32:16 khussey Exp $
*/
package org.eclipse.uml2.uml.internal.operations;
@@ -25,6 +25,7 @@ import org.eclipse.emf.common.util.UniqueEList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.uml2.uml.Dependency;
+import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.Namespace;
import org.eclipse.uml2.uml.UMLPackage;
@@ -319,11 +320,11 @@ public class NamedElementOperations
public static EList allOwningPackages(NamedElement namedElement) {
EList allOwningPackages = new UniqueEList.FastCompare();
- for (Namespace namespace = namedElement.getNamespace(); namespace != null; namespace = namespace
- .getNamespace()) {
+ for (Element owner = namedElement.getOwner(); owner != null; owner = owner
+ .getOwner()) {
- if (namespace instanceof org.eclipse.uml2.uml.Package) {
- allOwningPackages.add(namespace);
+ if (owner instanceof org.eclipse.uml2.uml.Package) {
+ allOwningPackages.add(owner);
}
}
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/PackageOperations.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/PackageOperations.java
index e465f332..03be189d 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/PackageOperations.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/PackageOperations.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
*
- * $Id: PackageOperations.java,v 1.25 2006/05/02 21:51:04 khussey Exp $
+ * $Id: PackageOperations.java,v 1.26 2006/05/23 17:32:16 khussey Exp $
*/
package org.eclipse.uml2.uml.internal.operations;
@@ -45,7 +45,6 @@ import org.eclipse.uml2.uml.ElementImport;
import org.eclipse.uml2.uml.Enumeration;
import org.eclipse.uml2.uml.Interface;
import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Namespace;
import org.eclipse.uml2.uml.PrimitiveType;
import org.eclipse.uml2.uml.Profile;
import org.eclipse.uml2.uml.ProfileApplication;
@@ -631,11 +630,11 @@ public class PackageOperations
if (appliedProfile == null && recurse) {
- for (Namespace namespace = package_.getNamespace(); namespace != null
- && appliedProfile == null; namespace = namespace.getNamespace()) {
+ for (Element owner = package_.getOwner(); owner != null
+ && appliedProfile == null; owner = owner.getOwner()) {
- if (namespace instanceof org.eclipse.uml2.uml.Package) {
- appliedProfile = ((org.eclipse.uml2.uml.Package) namespace)
+ if (owner instanceof org.eclipse.uml2.uml.Package) {
+ appliedProfile = ((org.eclipse.uml2.uml.Package) owner)
.getAppliedProfile(qualifiedName);
}
}
@@ -700,12 +699,11 @@ public class PackageOperations
if (profileApplication == null && recurse) {
- for (Namespace namespace = package_.getNamespace(); namespace != null
- && profileApplication == null; namespace = namespace
- .getNamespace()) {
+ for (Element owner = package_.getOwner(); owner != null
+ && profileApplication == null; owner = owner.getOwner()) {
- if (namespace instanceof org.eclipse.uml2.uml.Package) {
- profileApplication = ((org.eclipse.uml2.uml.Package) namespace)
+ if (owner instanceof org.eclipse.uml2.uml.Package) {
+ profileApplication = ((org.eclipse.uml2.uml.Package) owner)
.getProfileApplication(profile);
}
}

Back to the top