Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354019 - NPE when launching diff
Summary: NPE when launching diff
Status: CLOSED FIXED
Alias: None
Product: EMFCompare
Classification: Modeling
Component: Core (show other bugs)
Version: 1.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: EMF Compare CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-05 11:27 EDT by William Piers CLA
Modified: 2011-08-09 04:36 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description William Piers CLA 2011-08-05 11:27:23 EDT
Bug detected on build I201108051005 (2011/08/05) 

When launching a diff I get the following NPE:
java.lang.NullPointerException
	at org.eclipse.emf.compare.diff.engine.check.ReferencesCheck.checkContainmentReferenceOrderChange(ReferencesCheck.java:151)
	at org.eclipse.emf.compare.diff.engine.check.ReferencesCheck.checkReferencesUpdates(ReferencesCheck.java:80)
	at org.eclipse.emf.compare.diff.engine.GenericDiffEngine.checkForDiffs(GenericDiffEngine.java:336)
	at org.eclipse.emf.compare.diff.engine.GenericDiffEngine.doDiffDelegate(GenericDiffEngine.java:890)
	at org.eclipse.emf.compare.diff.engine.GenericDiffEngine.doDiffDelegate(GenericDiffEngine.java:913)
	at org.eclipse.emf.compare.diff.engine.GenericDiffEngine.doDiffDelegate(GenericDiffEngine.java:913)
	at org.eclipse.emf.compare.diff.engine.GenericDiffEngine.doDiffDelegate(GenericDiffEngine.java:913)
	at org.eclipse.emf.compare.diff.engine.GenericDiffEngine.doDiffDelegate(GenericDiffEngine.java:913)
	at org.eclipse.emf.compare.diff.engine.GenericDiffEngine.doDiffTwoWay(GenericDiffEngine.java:572)
	at org.eclipse.emf.compare.diff.engine.GenericDiffEngine.doDiff(GenericDiffEngine.java:110)
	at org.eclipse.emf.compare.diff.service.DiffService.doDiff(DiffService.java:102)

It appears that in org.eclipse.emf.compare.diff.engine.check.AbstractCheck.getMatchedEObject(EObject), the crossReferencer.get(from) returns null.
Comment 1 Laurent Goubet CLA 2011-08-08 04:35:50 EDT
The cross referencer is returning null here because the object is out of the scope. Scope should be taken into account when checking for containment reference ordering.
Comment 2 Laurent Goubet CLA 2011-08-09 04:36:00 EDT
The match, diff and merge process have seen a great deal of improvement in the past week, with the addition of unit tests for most of the different use cases (one use case = one possible "diff" between models) we could think of.

The particular issue with scope-external EObjects is one of the things that has been tested and fixed.

These changes have been pushed on both master and the 1.2 maintenance stream. They are available in the builds
 - 1.2 integration : I201108090404
 - 1.3 integration : I201108090415