| Summary: | ClassCastException in ModelContentMergerViewer | ||
|---|---|---|---|
| Product: | [Modeling] EMFCompare | Reporter: | Mikaël Barbero <mikael.barbero> |
| Component: | Core | Assignee: | EMF Compare <emf.compare-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | laurent.goubet, mikael.barbero |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
This is a regression which should be fixed in RC2 |
When comparing two local resources (Compare > With each other menu) and by selecting "complete resourceSet", a ClassCastException occurs when trying to save the resources after one merge operation (a simple updateAttribute). It appears that in ModelContentMergerViewer#getContents(boolean), the input is a List<?> and not a TypedElementWrapper nor a Resource. The resource is contained in the singleton List<?> This change works for me: == before == final Resource resource; if (input instanceof TypedElementWrapper) { resource = ((TypedElementWrapper)input).getObject().eResource(); } else { resource = (Resource)input; } == after == final Resource resource; if (input instanceof TypedElementWrapper) { resource = ((TypedElementWrapper)input).getObject().eResource(); } else if (input instanceof List<?>) { resource = (Resource)((List<?>)input).get(0); } else { resource = (Resource)input; }