Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361514 - [EMF Compare UML] Delete an element with a stereotype create a polluting difference
Summary: [EMF Compare UML] Delete an element with a stereotype create a polluting diff...
Status: CLOSED FIXED
Alias: None
Product: EMFCompare
Classification: Modeling
Component: Core (show other bugs)
Version: 1.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: EMF Compare CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-20 05:46 EDT by Arthur Daussy CLA
Modified: 2012-05-22 09:29 EDT (History)
3 users (show)

See Also:


Attachments
Models to reproduce the bug (3.91 KB, application/zip)
2011-10-20 05:46 EDT, Arthur Daussy CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arthur Daussy CLA 2011-10-20 05:46:30 EDT
Created attachment 205601 [details]
Models to reproduce the bug

When delete an element with a stereotype a UMLStereotypeApplicationRemoval diff is created. Which look like: 
Stereotype <Stereotype> Block has been unapplied on null.

How to reproduce:
 1. Create two model with one element stereotyped
 2. Delete this element in the "left" model
 3. Run comparison
 4. See result.
(See also models in attachment)

My guess is that the problem come from UMLStereotypeApplicationRemovalFactory.handles(DiffElement) which should test that the left based element is still available. I have tried to correct with:

	public boolean handles(DiffElement input) {
		if (input instanceof ModelElementChangeRightTarget) {
			final EObject rightElement = ((ModelElementChangeRightTarget)input).getRightElement();
			final Element rightBase = UMLUtil.getBaseElement(rightElement);
			if (rightBase != null) {
				final EObject leftBase = getEngine().getMatched(rightBase, MatchSide.LEFT);
				return leftBase != null;
			}
		}
		return false;
	}

But there is still some problems.

Regards,
Comment 1 Cedric Notot CLA 2011-10-28 12:59:27 EDT
This bug is linked with 361344. It is the same issue.

The fix and explanations are in this last one (Bug 361344).

Regards,
Cedric Notot
Comment 2 Laurent Goubet CLA 2011-11-03 05:01:59 EDT
Arthur, the build I outlined in bug 361344, comment 3 should also contains the fix for this. Could you verify the fix from your side?
Comment 3 Laurent Goubet CLA 2012-05-22 09:29:48 EDT
Closing now