Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » EMF Compare crashing when merging Sirius models
EMF Compare crashing when merging Sirius models [message #1862994] Wed, 10 January 2024 10:28 Go to next message
Tom Westbury is currently offline Tom WestburyFriend
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 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
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
Re: EMF Compare crashing when merging Sirius models [message #1863331 is a reply to message #1863302] Fri, 26 January 2024 11:23 Go to previous message
Tom Westbury is currently offline Tom WestburyFriend
Messages: 11
Registered: December 2022
Junior Member
Thank you Laurent,

That confirms my suspicion that its duplicate IDs causing the crash

I'm still unsure as to why there are duplicate IDs in the model or across different versions but I'll do some digging and post my resolution here

Many thanks,

Tom

Previous Topic:NPE in ReferenceChangeMerger
Next Topic:Class loader error - two versions of Guava
Goto Forum:
  


Current Time: Thu Jan 02 22:23:38 GMT 2025

Powered by FUDForum. Page generated in 0.03542 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top