Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 256889 - [Viewers] [table] IAE (Index out of bounds) after selecting rows in virtual TableViewer
Summary: [Viewers] [table] IAE (Index out of bounds) after selecting rows in virtual T...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.5 M5   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 251829
  Show dependency tree
 
Reported: 2008-11-28 07:50 EST by Stefan Röck CLA
Modified: 2009-01-30 10:36 EST (History)
2 users (show)

See Also:


Attachments
Snippet to reproduce the bug (5.03 KB, text/plain)
2008-11-28 07:51 EST, Stefan Röck CLA
no flags Details
fix (1.41 KB, patch)
2008-12-01 10:51 EST, Boris Bokowski CLA
no flags Details | Diff
Testcase for bug (5.23 KB, text/plain)
2008-12-12 03:15 EST, Stefan Röck CLA
bokowski: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Röck CLA 2008-11-28 07:50:16 EST
Steps to reproduce:
- Load the attached snippet
- Press button "Select all elements"

The button's selection listener first calls table.selectAll(); and then loads the current selection of the TableViewer via tableViewer.getSelection();

--> Exception:
Exception in thread "main" java.lang.IllegalArgumentException: Index out of bounds
	at org.eclipse.swt.SWT.error(SWT.java:3761)
	at org.eclipse.swt.SWT.error(SWT.java:3695)
	at org.eclipse.swt.SWT.error(SWT.java:3666)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:463)
	at org.eclipse.swt.widgets.Table.getItem(Table.java:2262)
	at org.eclipse.jface.viewers.TableViewer.doGetItem(TableViewer.java:233)
	at org.eclipse.jface.viewers.AbstractTableViewer.getVirtualSelection(AbstractTableViewer.java:498)
	at org.eclipse.jface.viewers.AbstractTableViewer.getSelectionFromWidget(AbstractTableViewer.java:468)
	at org.eclipse.jface.viewers.StructuredViewer.getSelection(StructuredViewer.java:972)
	at VirtualTableTest$2.widgetSelected(VirtualTableTest.java:98)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
	at VirtualTableTest.runTableTest(VirtualTableTest.java:162)
	at VirtualTableTest.main(VirtualTableTest.java:175)
Comment 1 Stefan Röck CLA 2008-11-28 07:51:13 EST
Created attachment 118991 [details]
Snippet to reproduce the bug
Comment 2 Boris Bokowski CLA 2008-12-01 10:51:48 EST
Created attachment 119153 [details]
fix

This patch fixes the problem. Would you be able to contribute a test case for our automated test suite? http://wiki.eclipse.org/Platform_UI/How_to_Contribute
Comment 3 Stefan Röck CLA 2008-12-12 03:15:43 EST
Created attachment 120286 [details]
Testcase for bug

Boris, sorry for late response. Here is the test case. I hope it meets your expectations...
Comment 4 Boris Bokowski CLA 2009-01-21 15:43:31 EST
Released to HEAD. Thanks for the test case!
Comment 5 Oleg Besedin CLA 2009-01-30 10:36:29 EST
Verified in I20090129-0100 - both the test case snippet and Junit run fine.