| Summary: | DefaultMerger should not clean DiffGroup with hidden sub diff elements | ||
|---|---|---|---|
| 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 |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
|
Description
Mikaël Barbero
The patch is to change the method DefaultMerger#cleanDiffGroup(DiffGroup) from
protected void cleanDiffGroup(DiffGroup diffGroup) {
if (diffGroup != null && diffGroup.getSubchanges() == 0) {
final EObject parent = diffGroup.eContainer();
if (parent instanceof DiffGroup) {
EcoreUtil.remove(diffGroup);
cleanDiffGroup((DiffGroup)parent);
}
}
}
to
protected void cleanDiffGroup(DiffGroup diffGroup) {
if (diffGroup != null && diffGroup.getSubDiffElements().isEmpty()) { // This line is different
final EObject parent = diffGroup.eContainer();
if (parent instanceof DiffGroup) {
EcoreUtil.remove(diffGroup);
cleanDiffGroup((DiffGroup)parent);
}
}
}
This had been fixed on master with "diffGroup.getSubDiffElements().size() == 0". |