Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322155 - emfdiff model with ReferenceOrderChanges raise an error when loaded again
Summary: emfdiff model with ReferenceOrderChanges raise an error when loaded again
Status: CLOSED WONTFIX
Alias: None
Product: EMFCompare
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: EMF Compare CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-09 12:34 EDT by Andreas Mayer CLA
Modified: 2013-01-11 10:21 EST (History)
1 user (show)

See Also:


Attachments
Model and editor plugins to demonstrate the issue (128.28 KB, application/octet-stream)
2010-08-09 12:36 EDT, Andreas Mayer CLA
no flags Details
Demo models (1.52 KB, application/octet-stream)
2010-08-09 12:36 EDT, Andreas Mayer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.