Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319548 - NPE while building DiffModel, when using a Scope Provider in MatchModel
Summary: NPE while building DiffModel, when using a Scope Provider in MatchModel
Status: CLOSED FIXED
Alias: None
Product: EMFCompare
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: EMF Compare CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-12 08:11 EDT by Alex Lagarde CLA
Modified: 2011-08-09 05:33 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Lagarde CLA 2010-07-12 08:11:21 EDT
When I have created my MatchModel using a ScopeProvider : 

Map<String, Object> optionsMap = new HashMap<String, Object>();
optionsMap.put(MatchOptions.OPTION_MATCH_SCOPE_PROVIDER, new MyScopeProvider());

match = new MyMatchEngine().contentMatch(leftRoot,
				rightRoot, optionsMap);

the following call : 

DiffModel diff = DiffService.doDiff(match,false);
raises the following exception : 

java.lang.NullPointerException
	at org.eclipse.emf.compare.diff.engine.check.AbstractCheck.isUnmatched(AbstractCheck.java:155)
	at org.eclipse.emf.compare.diff.engine.check.ReferencesCheck.checkContainmentReferenceOrderChange(ReferencesCheck.java:147)
	at org.eclipse.emf.compare.diff.engine.check.ReferencesCheck.checkReferencesUpdates(ReferencesCheck.java:79)
	at org.eclipse.emf.compare.diff.engine.GenericDiffEngine.checkForDiffs(GenericDiffEngine.java:330)
	at org.eclipse.emf.compare.diff.engine.GenericDiffEngine.doDiffDelegate(GenericDiffEngine.java:884)
	at org.eclipse.emf.compare.diff.engine.GenericDiffEngine.doDiffDelegate(GenericDiffEngine.java:907)
	at org.eclipse.emf.compare.diff.engine.GenericDiffEngine.doDiffDelegate(GenericDiffEngine.java:907)
	at org.eclipse.emf.compare.diff.engine.GenericDiffEngine.doDiffDelegate(GenericDiffEngine.java:907)
	at org.eclipse.emf.compare.diff.engine.GenericDiffEngine.doDiffTwoWay(GenericDiffEngine.java:566)
	at org.eclipse.emf.compare.diff.engine.GenericDiffEngine.doDiff(GenericDiffEngine.java:105)
	at org.eclipse.emf.compare.diff.service.DiffService.doDiff(DiffService.java:102)


To correct this bug, the only thing to do seems to deal with the "crossReferencer.get(element) == null" situation (and return true in this case, as the object can be seen as unmatched).
Comment 1 Laurent Goubet CLA 2011-08-09 05:33:03 EDT
bug 320496 was a duplicate of this one. This specific NPE has been fixed.