diff options
author | Kenn Hussey | 2016-10-11 19:56:59 +0000 |
---|---|---|
committer | Kenn Hussey | 2016-10-11 19:56:59 +0000 |
commit | 2f1b0e0b94914a645ed429a84d5eef8e93bbb1cb (patch) | |
tree | 5dc0a96c3f3496aa74047bb35ff0e4229f6b411d | |
parent | 7eb88828d025eea1029e5469986ca806b2ed60ee (diff) | |
download | org.eclipse.uml2-2f1b0e0b94914a645ed429a84d5eef8e93bbb1cb.tar.gz org.eclipse.uml2-2f1b0e0b94914a645ed429a84d5eef8e93bbb1cb.tar.xz org.eclipse.uml2-2f1b0e0b94914a645ed429a84d5eef8e93bbb1cb.zip |
[505724] Making Property::opposite independent of navigability.
-rw-r--r-- | plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/PropertyOperations.java | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/PropertyOperations.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/PropertyOperations.java index 432dc8778..faaa8a986 100644 --- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/PropertyOperations.java +++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/PropertyOperations.java @@ -8,7 +8,7 @@ * Contributors: * IBM - initial API and implementation * Kenn Hussey - 323181 - * Kenn Hussey (CEA) - 327039, 351774, 407028, 418466, 433195, 439915, 451350, 485756 + * Kenn Hussey (CEA) - 327039, 351774, 407028, 418466, 433195, 439915, 451350, 485756, 505724 * */ package org.eclipse.uml2.uml.internal.operations; @@ -667,20 +667,17 @@ public class PropertyOperations * @generated NOT */ public static Property getOpposite(Property property) { + Association association = property.getAssociation(); - if (property.isNavigable()) { - Association association = property.getAssociation(); - - if (association != null) { - EList<Property> memberEnds = association.getMemberEnds(); + if (association != null) { + EList<Property> memberEnds = association.getMemberEnds(); - if (memberEnds.size() == 2) { - int index = memberEnds.indexOf(property); + if (memberEnds.size() == 2) { + int index = memberEnds.indexOf(property); - if (index != -1) { - return ((InternalEList<Property>) memberEnds) - .basicGet(Math.abs(index - 1)); - } + if (index != -1) { + return ((InternalEList<Property>) memberEnds) + .basicGet(1 - index); } } } |