|EMF Compare Customization (FIXED) [message #1730999]
||Mon, 02 May 2016 04:15
| Neeraj Bhusare
Registered: July 2009
I have created a language (Xtext)  that allows defining Java like Classes (named SmallClazz) and attributes in it. The attribute has a name and a DataType. The DataType is of BasicType or ClassType. Please note that a ClassType represents a reference to the SmallClazz instance.
I am working on an sample project  that makes use of EMF Compare to find the differences betwee the instances of SmallClazz type. As outlined in the developer guide , I have cutomized the DiffBuilder  and ignored few compare phases  that are not of my interest.
I have a set of unit-tests  for the above EMF Compare customizations. All the tests are green except the one that tries to test the changes made to the attribute DataType . To be very specific, the change to the datatype is from a ClassType (Foo) to another ClassType (Bar). Now, I have gree tests  for changes to datatype from - BasicType to another BasicType, and BasicType to ClassType.
Based on my investigation, I found that the Match object that matches the two ClassType (Foo and Bar) instances contains a null differences list . As a workaround, I customized the Matcher to make use of the referred SmallClazz name while matching the ClasstType instances , but that leads to a NPE . I was not successful in finding the cause. I'll be greatful if someone could explain.
Am I missing something here ?
I am on Mars.2 Release (4.5.2), EMF Compare 18.104.22.168509120604.
 https://goo.gl/xG9zjq - See methods : getCustomEquivalenceEngine(), getCustomConflictDetector() and getCustomDiffEngine()
 https://goo.gl/P78rzh - See test : testAttributeDataTypeChangedFromClassTypeToClassType()
 https://goo.gl/P78rzh - See tests : testAttributeDataTypeChangedFromBasicTypeToBasicType(), testAttributeDataTypeChangedFromBasicTypeToClassType()
 https://goo.gl/rnMeUI - See method : getCustomMatcher(), line 102.
Tx in advance.
Twitter : @NeerajBhusare
Blog : https://nbhusare.github.io/
Best regards, Neeraj
[Updated on: Thu, 12 May 2016 00:43]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01314 seconds