EMF Compare Customization (FIXED) [message #1730999] |
Mon, 02 May 2016 04:15 |
Neeraj Bhusare Messages: 177 Registered: July 2009 Location: Canada |
Senior Member |
|
|
Hi All,
I have created a language (Xtext) [0] 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 [1] that makes use of EMF Compare to find the differences betwee the instances of SmallClazz type. As outlined in the developer guide [2], I have cutomized the DiffBuilder [3] and ignored few compare phases [4] that are not of my interest.
I have a set of unit-tests [5] 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 [6]. To be very specific, the change to the datatype is from a ClassType (Foo) to another ClassType (Bar). Now, I have gree tests [7] 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 [8]. As a workaround, I customized the Matcher to make use of the referred SmallClazz name while matching the ClasstType instances [9], but that leads to a NPE [10]. 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 3.1.1.201509120604.
[0] https://goo.gl/NfBaVd
[1] https://goo.gl/w4YkHT
[2] https://goo.gl/KmNbAE
[3] https://goo.gl/9VptVI
[4] https://goo.gl/xG9zjq - See methods : getCustomEquivalenceEngine(), getCustomConflictDetector() and getCustomDiffEngine()
[5] https://goo.gl/P78rzh
[6] https://goo.gl/P78rzh - See test : testAttributeDataTypeChangedFromClassTypeToClassType()
[7] https://goo.gl/P78rzh - See tests : testAttributeDataTypeChangedFromBasicTypeToBasicType(), testAttributeDataTypeChangedFromBasicTypeToClassType()
[8] https://goo.gl/g0SPrU
[9] https://goo.gl/rnMeUI - See method : getCustomMatcher(), line 102.
[10] https://goo.gl/JeIURM
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.03642 seconds