I am trying to detect conflicting changes between two models without modifying the files in which these models are serialized on the file system. In other words, I would like to perform this operation in core.
I am therefore using the following line of code to obtain a ResolveMerger instance:
ResolveMerger merger = (ResolveMerger) new StrategyRecursiveModel().newMerger(repo, true);
Notice that the inCore parameter of newMerger() is set to true.
When invoking the merge() method of this ResolveMerger instance, the call is eventually delegated to the merge() method of the EMFResourceMappingMerger class. This method always modifies the model files if it detects conflicts, effectively violating the contract of the newMerger(repo, true) call above by ignoring the value of the inCore parameter.
Is this apparent contract violation a bug?
And is there a way to use the EMFResourceMappingMerger without modifying any files on the file system?
The EMFResourceMappingMerger doesn't support in-memory operations for now. We do not know how hard it would be to support this kind of calls but this support isn't planned for inclusion in the foreseeable future as the focus of our development is on the merging itself. Please raise an enhancement request against EMF Compare on the eclipse bugzilla to report this limitation in case other people might be interested for this feature to be plannified in a future release. Feel free to contact Obeo if you are interested yourself in working on this issue together with us.