Community
Participate
Working Groups
this problem refers to the current implementation of org.eclipse.m2m.atl.drivers.emf4atl.ASMModel (checkout date: 25.08.2010) BACKGROUND: To keep track of current EMF model elements, these are index by their corresponding EMF-objects (as keys) in a HashMap in the field 'modelElements' (in class ASMModel). Before adding newly created EMF model elements this map is queried, and in case there already is an entry for the corresponding EMF-object, the existing model element (as referenced by the HashMap) is used. PROBLEM: A problem occurs when several newly initialized EMF-objects of the same type are to be added as target-elements of a transformation, or more specifically, when they have not yet been modified/changed by the transformation: Since their hash-values are the same, querying the HashMap 'modelElements' for existing EMF model elements will return TRUE, although the EMF-objects should refer to different EMF model elements. Thus the same EMF model element will be used as target element for different source-EMF-objects during the transformation. SOLUTION: A quick solution to this problem would be, to use an IdentityHashMap for the field 'modelElements' (instead of a HashMap).