| Summary: | ArrayIndexOutOfBoundException when comparing identical resources | ||
|---|---|---|---|
| Product: | [Modeling] EMFCompare | Reporter: | Mikaël Barbero <mikael.barbero> |
| Component: | Core | Assignee: | EMF Compare <emf.compare-inbox> |
| Status: | CLOSED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | laurent.goubet, mikael.barbero |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
This seems to have been fixed since. |
I got a corner case when trying to compare identical resources, ModelContentMergeDiffTab#mapDifference() is throwing me an ArrayIndexOutOfBoundException. The else statement should test the items array of the tree for emptyness before accessing it. The comment says to do something else, but I don't see what. Maybe the real fix is not the test for emptyness, but to remove the TODO ;) } else { // TODO for now, we're using the first item's data, we should // look for the matchedElement TreeItem[] items = getTree().getItems(); if (items.length > 0) { dataToDiff.put(items[0].getData(), diff); } }