Community
Participate
Working Groups
Hallo, the following easy JUnit TestCase demonstrates that a second call to getTargetDirectedRelationships(EClass eClass) on an org.eclipse.uml2.uml.Interface Impl-Class may return wrong values (no values). I suppose this also holds for other classes who use the same implementation and is caused to a caching effect. What do you think? import java.util.List; import junit.framework.TestCase; import org.eclipse.uml2.uml.UMLFactory; import org.eclipse.uml2.uml.UMLPackage; public class TargetDirectedRelationshipsTest extends TestCase { public void testTargetDirectedRelationships(){ org.eclipse.uml2.uml.Class class_ = UMLFactory.eINSTANCE.createClass(); org.eclipse.uml2.uml.Interface interface_ = UMLFactory.eINSTANCE.createInterface(); class_.createInterfaceRealization("interfaceRealizatio", interface_); //!! IMPORTANT: if the following line is uncommented, test case failes due to cache effect! // interface_.getTargetDirectedRelationships(UMLPackage.eINSTANCE.getGeneralization()); List targetRelationships = interface_.getTargetDirectedRelationships(); List interfaceRealizationTargetRelationships = interface_.getTargetDirectedRelationships(UMLPackage.eINSTANCE.getInterfaceRealization()); assertTrue(targetRelationships.size() == interfaceRealizationTargetRelationships.size()); } }
The fix has been committed to CVS.
Fixed in M200607131314.
Move to verified as per bug 206558.