Bug 149972 - getTargetDirectedRelationships(EClass eClass) does not return correct values on repeated calls due to cache effects
Summary: getTargetDirectedRelationships(EClass eClass) does not return correct values ...
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-07-07 09:39 EDT by Alexander Nyßen CLA
Modified: 2008-01-28 16:36 EST (History)
0 users

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-07-07 09:39:53 EDT
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());
	}
}
Comment 1 Kenn Hussey CLA 2006-07-10 09:46:37 EDT
The fix has been committed to CVS.
Comment 2 Kenn Hussey CLA 2006-07-13 14:08:10 EDT
Fixed in M200607131314.
Comment 3 Nick Boldt CLA 2008-01-28 16:36:01 EST
Move to verified as per bug 206558.