Project: SWT
Bug 22918 Table.getItem(Point) throws ArrayIndexOutOfBounds
Reported: 2002-08-27 16:37:11 | Status: resolved fixed

Run the following code and you will get the exception. Seems like a bug in GTK that we need to work around. Even though the point is outside the Table, OS.gtk_clist_get_selection_info returns 1 and the value for row[0] is a negative number. public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); final Table table = new Table(shell, SWT.BORDER); for (int i = 0; i < 20; i++) { TableItem item = new TableItem(table, SWT.NONE); item.setText("item " + i); } shell.open(); table.getItem(new Point(-1000, -1000)); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java