Bug 157976 - org.eclipse.uml2.uml.internal.operations.PropertyOperations.getOpposite(Property property) should also return navigable opposite ends owned by binary associations.
Summary: org.eclipse.uml2.uml.internal.operations.PropertyOperations.getOpposite(Prope...
Status: VERIFIED FIXED
Alias: None
Product: MDT.UML2
Classification: Modeling
Component: Core (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Kenn Hussey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-20 08:59 EDT by Alexander Nyßen CLA
Modified: 2008-01-28 16:36 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Nyßen CLA 2006-09-20 08:59:29 EDT
UML2 Superstructure 2.1 says: "An end property of an association that is owned by an end class or that is a navigable owned end of the association indicates that the association is navigable from the opposite ends, otherwise the association is not navigable from the opposite ends."

The current implementation of PropertyOperations.getOpposite does only return an opposite end if the given property is not owned by an association and therefore does not obey the specificatio in this point (it does indeed also contradict the javadoc-comment given in org.eclipse.uml2.uml.Property.getOpposite()).

I would therefore suppose to alter the implementation of PropertyOperations.getOppsosite() - to at least support that for navigable associations getOpposite can also be used if the property is owned by the association - as follows:

public static Property getOpposite(Property property) {

		if ((property.getOwningAssociation() != null && property.getOwningAssociation().isBinary() && property.isNavigable()) 
		  || property.getOwningAssociation() == null) {
			Property otherEnd = getOtherEnd(property);

			if (otherEnd != null && otherEnd.isNavigable()) {
				return otherEnd;
			}
		}

		return null;
	}
Comment 1 Kenn Hussey CLA 2006-09-20 23:22:57 EDT
The fix has been committed to CVS.
Comment 2 Kenn Hussey CLA 2006-09-21 10:04:03 EDT
Fixed in M200609210850.
Comment 3 Nick Boldt CLA 2008-01-28 16:36:14 EST
Move to verified as per bug 206558.