Bug 529670 - GridLayoutProvider throws IndexOutOfBoundsException
Summary: GridLayoutProvider throws IndexOutOfBoundsException
Status: UNCONFIRMED
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 5.1.0   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2018-01-11 08:44 EST by Robert Stelzmann CLA
Modified: 2018-02-13 04:16 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Stelzmann CLA 2018-01-11 08:44:11 EST
The GridLayoutProvider throws an IndexOutOfBoundsException if the GridView provides columns with different heights.

The problem is the implementation of getLocation, more specifically:

final View leftView = gridView.getViewAt(x - 1, y);
Dimension size = new Dimension(0, 0);
if (leftView != null) {
   final IGraphicalEditPart leftEditPart = viewsToEditParts.get(leftView);
   size = this.getBounds(leftEditPart).getSize();
}

The null-check is meaningless, since gridView.getViewAt(x - 1, y); will crash with the aforementioned exception if no such element exists.
Comment 1 Maxime Porhel CLA 2018-02-13 04:16:53 EST
Hi Robert, 

Could you provide some steps to reproduce, more details on your your environment (diagram description and your customizations) and maybe a screenshot of the diagram on which you encounter the issue ? 

Regards