[407028] Looking at all inverse references when computing isAttribute.
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 940fe24..5df1b1c 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011 IBM Corporation, CEA, and others.
+ * Copyright (c) 2005, 2013 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
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
* Kenn Hussey - 323181
- * Kenn Hussey (CEA) - 327039, 351774
+ * Kenn Hussey (CEA) - 327039, 351774, 407028
*
*/
package org.eclipse.uml2.uml.internal.operations;
@@ -478,8 +478,8 @@
*/
public static boolean isAttribute(Property property, Property p) {
- for (EStructuralFeature.Setting nonNavigableInverseReference : getNonNavigableInverseReferences(p)) {
- EObject eObject = nonNavigableInverseReference.getEObject();
+ for (EStructuralFeature.Setting inverseReference : getInverseReferences(p)) {
+ EObject eObject = inverseReference.getEObject();
if (eObject instanceof Classifier
&& ((Classifier) eObject).getAttributes().contains(p)) {
diff --git a/tests/org.eclipse.uml2.uml.tests/src/org/eclipse/uml2/uml/tests/PropertyTest.java b/tests/org.eclipse.uml2.uml.tests/src/org/eclipse/uml2/uml/tests/PropertyTest.java
index 50aa499..bb65a44 100644
--- a/tests/org.eclipse.uml2.uml.tests/src/org/eclipse/uml2/uml/tests/PropertyTest.java
+++ b/tests/org.eclipse.uml2.uml.tests/src/org/eclipse/uml2/uml/tests/PropertyTest.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - initial API and implementation
* Kenn Hussey - 323181
- * Kenn Hussey (CEA) - 327039, 351774, 212765
+ * Kenn Hussey (CEA) - 327039, 351774, 212765, 407028
*
*/
package org.eclipse.uml2.uml.tests;
@@ -601,11 +601,19 @@
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.uml2.uml.Property#isAttribute(org.eclipse.uml2.uml.Property)
- * @generated
+ * @generated NOT
*/
public void testIsAttribute__Property() {
- // TODO: implement this feature getter test method
- // Ensure that you remove @generated or mark it @generated NOT
+ assertFalse(getFixture().isAttribute(getFixture()));
+
+ org.eclipse.uml2.uml.Class class_ = UMLFactory.eINSTANCE.createClass();
+ class_.getOwnedAttributes().add(getFixture());
+
+ assertTrue(getFixture().isAttribute(getFixture()));
+
+ class_.getOwnedAttributes().remove(getFixture());
+
+ assertFalse(getFixture().isAttribute(getFixture()));
}
/**