EMF Compare crashing when merging Sirius models [message #1862994] |
Wed, 10 January 2024 10:28 |
Tom Westbury Messages: 11 Registered: December 2022 |
Junior Member |
|
|
Edit with more context:
The error seems to be a NPE at getFeatureID. From this thread (https://bugs.eclipse.org/bugs/show_bug.cgi?id=521103), the error seems to be caused by duplicate IDs with different eClasses. Could there be another reason for this error?
Our ECore metamodel uses custom ids that are set on creation of the object in the VSM using the eCore uid method.
Could there be any possibility of accidental duplicate IDs via this method?
The Stack trace of the error is:
java.lang.NullPointerException
at org.eclipse.emf.ecore.impl.EClassImpl.getFeatureID(EClassImpl.java:1500)
at org.eclipse.emf.compare.utils.ReferenceUtil.getFeatureID(ReferenceUtil.java:206)
at org.eclipse.emf.compare.utils.ReferenceUtil.safeEGet(ReferenceUtil.java:129)
at org.eclipse.emf.compare.diff.DefaultDiffEngine.computeSingleValuedReferenceDifferencesThreeWay(DefaultDiffEngine.java:1484)
at org.eclipse.emf.compare.diff.DefaultDiffEngine.computeDifferences(DefaultDiffEngine.java:777)
at org.eclipse.emf.compare.diff.DefaultDiffEngine.internalCheckForDifferences(DefaultDiffEngine.java:180)
at org.eclipse.emf.compare.diff.DefaultDiffEngine.internalCheckForDifferences(DefaultDiffEngine.java:191)
at org.eclipse.emf.compare.diff.DefaultDiffEngine.internalCheckForDifferences(DefaultDiffEngine.java:191)
at org.eclipse.emf.compare.diff.DefaultDiffEngine.checkForDifferences(DefaultDiffEngine.java:156)
at org.eclipse.emf.compare.diff.DefaultDiffEngine.diff(DefaultDiffEngine.java:129)
at org.eclipse.emf.compare.EMFCompare.compare(EMFCompare.java:240)
at org.eclipse.emf.compare.ide.ui.internal.logical.EMFResourceMappingMerger.mergeMapping(EMFResourceMappingMerger.java:266)
at org.eclipse.emf.compare.ide.ui.internal.logical.EMFResourceMappingMerger.merge(EMFResourceMappingMerger.java:143)
at org.eclipse.emf.compare.egit.internal.merge.RecursiveModelMerger$ModelMerge.run(RecursiveModelMerger.java:441)
at org.eclipse.emf.compare.egit.internal.merge.RecursiveModelMerger$ModelMerge.access$1(RecursiveModelMerger.java:436)
at org.eclipse.emf.compare.egit.internal.merge.RecursiveModelMerger.mergeTreeWalk(RecursiveModelMerger.java:249)
at org.eclipse.jgit.merge.ResolveMerger.mergeTrees(ResolveMerger.java:1355)
at org.eclipse.emf.compare.egit.internal.merge.RecursiveModelMerger.mergeTrees(RecursiveModelMerger.java:135)
at org.eclipse.jgit.merge.ResolveMerger.mergeImpl(ResolveMerger.java:388)
at org.eclipse.jgit.merge.Merger.merge(Merger.java:233)
at org.eclipse.jgit.merge.Merger.merge(Merger.java:186)
at org.eclipse.jgit.merge.ThreeWayMerger.merge(ThreeWayMerger.java:96)
at org.eclipse.jgit.api.MergeCommand.call(MergeCommand.java:344)
at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:374)
at org.eclipse.egit.core.op.PullOperation$PullJob.run(PullOperation.java:256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Session Data:
eclipse.buildId=unknown
java.version=11.0.21
java.vendor=Microsoft
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Command-line arguments: -os win32 -ws win32 -arch x86_64
Hi,
We're using Obeo Designer 11.7 with a custom Sirius metamodel and working collaboratively with Egit and EMF Compare 3.3.18. The Java version is openJDK 11.0.10.
Ocasionally, we are unable to merge model changes as the EMF Compare tool will crash on "calculating differences". This error seems to affect certain commits (either way we attempt the merge) and can only be resolved by resetting the Git history on one branch to before the erroneous commit.
Does anyone here know of any issues in the .aird or model files that could cause this error as we are completely baffled as to what causes it.
Sirius has no issues opening a model in version in the commit that causes this error.
Any help on how to discover or resolve the issue would be greatly appreciated
Many thanks,
Tom
[Updated on: Thu, 11 January 2024 17:16] Report message to a moderator
|
|
|
Re: EMF Compare crashing when merging Sirius models [message #1863302 is a reply to message #1862994] |
Wed, 24 January 2024 17:20 |
|
Hello Tom,
This should happen when you have one objects with the same xmi:Id on both sides of the comparison, but these objects have different EClass (i.e. they cannot be compared at all in the first place).
EMF Compare does not support comparing objects with different EClasses. You will have to either modify your custom ID computation so that it cannot give the same identifier to objects with different classes (or reduce the possibility of conflicts such as using large UUID like the default from EMF does), or sub-class the differencing engine of EMF Compare to support this use case.
Regards,
Laurent Goubet
Obeo
|
|
|
|
Powered by
FUDForum. Page generated in 0.03542 seconds