Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327901 - NPE in ModelElementChangeRightTargetMerger
Summary: NPE in ModelElementChangeRightTargetMerger
Status: CLOSED FIXED
Alias: None
Product: EMFCompare
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: EMF Compare CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-15 10:56 EDT by Bernd CLA
Modified: 2011-03-10 04:03 EST (History)
2 users (show)

See Also:


Attachments
Project with models to reproduce this bug (1.37 KB, application/zip)
2010-10-15 10:58 EDT, Bernd CLA
no flags Details
Detailed stack trace showing the NPE (3.58 KB, text/plain)
2010-10-15 10:59 EDT, Bernd CLA
no flags Details
Second NPE occurred on save (4.37 KB, text/plain)
2010-10-15 11:27 EDT, Bernd CLA
no flags Details
Yet anoter NPE (3.32 KB, text/plain)
2010-10-15 13:21 EDT, Bernd CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd CLA 2010-10-15 10:56:59 EDT
Build Identifier: I20100608-0911

Follow steps to reproduce.

I suspect that the exception has sth. to do with the annotations at the EPackages of the 'A' models. If the annotation will be removed before merging the two models the exception won't happen.

By the way, I don't understand the changes on the annotations? The annotations are absolutely identical.

Reproducible: Always

Steps to Reproduce:
1. Import attached project
2. Select Ecore file A1 and A2
3. Choose 'Compare With -> Each Other' from context menu
4. Choose 'Selected resource(s) only' from the 'Match Model Selection' dialog
5. Select the change on the attribute under the EClass Clazz
6. Perform 'Copy Current Change from right to left

-> NPE in ModelElementChangeRightTargetMerger.applyInOrigin(...), see attached trace
Comment 1 Bernd CLA 2010-10-15 10:58:34 EDT
Created attachment 180963 [details]
Project with models to reproduce this bug
Comment 2 Bernd CLA 2010-10-15 10:59:50 EDT
Created attachment 180965 [details]
Detailed stack trace showing the NPE
Comment 3 Bernd CLA 2010-10-15 11:25:40 EDT
After removing the annotations in the 'A' models (see attached project) I was able to compare and merge the attribute. Sadly, I can't save the result because of another NPE. This time in ModelContentMergeViewer.getContents(...), see attached trace2.txt.

Decided to increase importance. Due to this bugs emf compare is unusable.

Using EMF Compare SDK 1.1.1.v201009150438 from the Helios update site.
Comment 4 Bernd CLA 2010-10-15 11:27:16 EDT
Created attachment 180971 [details]
Second NPE occurred on save
Comment 5 Bernd CLA 2010-10-15 13:21:51 EDT
Created attachment 180992 [details]
Yet anoter NPE

Got another NPE while trying to perform a merge programatically.

java.lang.NullPointerException
	at org.eclipse.emf.compare.diff.internal.merge.impl.ModelElementChangeLeftTargetMerger.undoInTarget(ModelElementChangeLeftTargetMerger.java:98)
	at org.eclipse.emf.compare.diff.merge.service.MergeService.doMerge(MergeService.java:166)
Comment 6 Laurent Goubet CLA 2011-03-10 04:03:18 EST
The NPEs outlined here have been fixed, the fix will be available in 1.2.0M6.

As for the problem with your annotations being detected as modified, it is due to you selecting "Selected resource(s) only" in your step 4 (when comparing). Your annotations contain links to another model, and thus they won't be matched if you're not considering the whole resource set for the comparison.

The NPE when saving has not been reproduced, considered fixed until someone reproduces it and provides us with reproduction steps.