Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 322155

Summary: emfdiff model with ReferenceOrderChanges raise an error when loaded again
Product: [Modeling] EMFCompare Reporter: Andreas Mayer <an.mayer>
Component: CoreAssignee: EMF Compare <emf.compare-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: laurent.goubet
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
Model and editor plugins to demonstrate the issue
none
Demo models none

Description Andreas Mayer CLA 2010-08-09 12:34:55 EDT
Build Identifier: 20100617-1415

EMF Compare's editor cannot reopen an emfdiff file containing a snapshot that includes a ReferenceOrderChange. A BasicIndexOutOfBoundsException will be thrown at:

EObjectResolvingEList<E>(BasicEList<E>).basicGet(int) line: 369	
ECrossReferenceEList$FeatureIteratorImpl<E>(EContentsEList$FeatureIteratorImpl<E>).hasNext() line: 485	
ECrossReferenceEList$FeatureIteratorImpl<E>(EContentsEList$FeatureIteratorImpl<E>).next() line: 565	
ModelCompareEditorInput$DispatchingCrossReferencer(EcoreUtil$CrossReferencer).handleCrossReference(EObject) line: 1696	
ModelCompareEditorInput$DispatchingCrossReferencer(EcoreUtil$CrossReferencer).crossReference() line: 1672	
ModelCompareEditorInput$DispatchingCrossReferencer.<init>(ModelCompareEditorInput, EObject, ResourceSet, ResourceSet, ResourceSet) line: 262	
ModelCompareEditorInput.resolveAll(ComparisonSnapshot) line: 222	
ModelCompareEditorInput.prepareInput(IProgressMonitor) line: 184	
ModelCompareEditorInput(CompareEditorInput).run(IProgressMonitor) line: 483	
ModalContext$ModalContextThread.run() line: 121	

The exception will be caught by EMF Compare and trigger a non-meaningful error dialog. 

Reproducible: Always

Steps to Reproduce:
The attached demoplugins.zip contains plugin projects for the following simple model and the accompanying editor: 

  class Thing
    name : String

  class OrderedContainer
    elements : Thing {ordered, containment}

I've also attached demo.zip, which contains two instances of the above model to be compared.

1. Run an Eclipse Application with the above plugins + EMF Compare.
2. Configure Eclipse to compare *.orderedmodel with EMF Compare.
3. Import the models from demo.zip and compare them.
4. Save the comparison result as emfdiff and close the compare editor.
5. Open the saved emfdiff file and the error dialog pops up.
Comment 1 Andreas Mayer CLA 2010-08-09 12:36:14 EDT
Created attachment 176166 [details]
Model and editor plugins to demonstrate the issue
Comment 2 Andreas Mayer CLA 2010-08-09 12:36:42 EDT
Created attachment 176167 [details]
Demo models
Comment 3 Laurent Goubet CLA 2013-01-11 10:21:17 EST
Not applicable to EMF Compare 2 as there is no way to export the comparison file. This will not be fixed in the 1.* stream.