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

Bug 313135

Summary: CopyingEpatchApplier throw IllegalArgumentException with multiple models
Product: [Modeling] EMFCompare Reporter: Simon Goodall <simon.goodall>
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 XP   
Whiteboard:

Description Simon Goodall CLA 2010-05-17 10:02:21 EDT
Build Identifier: 20100218-1602

I have generated an Epatch from a ResourceSet containing two different model based on different underlying ecore models.

When trying to apply the patch using the CopyingEpatchApplier class I get an IllegalArgumentException claiming my feature is not found.

This is caused by the CopyingEpatchApplier.matchResource(NamedResource,Resource) method trying to find a matching resource for the object. It results in trying to find the object with a feature from ecore model A in ecore model B which of course results in it unable to find the feature. Unfortunately this issue is not caught leading to the patch process to abort.

Reproducible: Always

Steps to Reproduce:
1. Create two different ecore models
2. Create an instance of each of the ecore models
3. Load both into a single ResourceSet
4. Create a EpatchRecorder with the resource set
5. Make some changes to the models
6. Generate the patch from the recorder
7. Create an instance of CopyingEpatchApplier, passing in patch, resourceset and Right_to_left mode
8. IllegalArgumentException is thrown.
Comment 1 Laurent Goubet CLA 2011-08-09 05:54:15 EDT
EPatch was a contribution from an external contributor which stopped
maintaining its work. It is now deprecated in favor of the MPatch plugins.