Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 121483 - [Viewers] IllegalArgumentException from SWT
Summary: [Viewers] IllegalArgumentException from SWT
Status: RESOLVED DUPLICATE of bug 154571
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.1   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 127949 130517 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-12-19 19:14 EST by Alexander Staubo CLA
Modified: 2006-08-21 13:08 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Staubo CLA 2005-12-19 19:14:26 EST
I wish I could extract more context for this bug report, but this is all I have: While editing I suddenly got an exception, which was shown in a a dialog box simply saying "Error", with the "Details" button grayed out. The following exception had been logged:

org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IllegalArgumentException: Index out of bounds)
at org.eclipse.swt.SWT.error(SWT.java:3283)
at org.eclipse.swt.SWT.error(SWT.java:3206)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:126)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3262)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2903)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1762)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1726)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:397)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:106)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:109)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:379)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at jrockit.reflect.InitialMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:338)
at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
Caused by: java.lang.IllegalArgumentException: Index out of bounds
at org.eclipse.swt.SWT.error(SWT.java:3267)
at org.eclipse.swt.SWT.error(SWT.java:3206)
at org.eclipse.swt.SWT.error(SWT.java:3177)
at org.eclipse.swt.widgets.TreeItem.findPrevious(TreeItem.java:208)
at org.eclipse.swt.widgets.TreeItem.<init>(TreeItem.java:118)
at org.eclipse.jface.viewers.TreeViewer.newItem(TreeViewer.java:528)
at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:534)
at org.eclipse.jface.viewers.AbstractTreeViewer.createAddedElements(AbstractTreeViewer.java:193)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalAdd(AbstractTreeViewer.java:181)
at org.eclipse.jface.viewers.TreeViewer.internalAdd(TreeViewer.java:811)
at org.eclipse.jface.viewers.AbstractTreeViewer.add(AbstractTreeViewer.java:124)
at org.eclipse.ui.progress.DeferredTreeContentManager$3.runInUIThread(DeferredTreeContentManager.java:305)
at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:93)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3262)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2899)
... 16 more

(This might be related to Mylar, which seems prone to such exceptions, but then again it might not.)

Eclipse 3.2M4.
Comment 1 Steve Northover CLA 2005-12-21 13:44:06 EST
Thanks for logging this bug.  Please reopen it if you see it again.
Comment 2 Markus Keller CLA 2006-02-15 10:09:22 EST
*** Bug 127949 has been marked as a duplicate of this bug. ***
Comment 3 Markus Keller CLA 2006-02-15 10:11:47 EST
Reopening since the same exception has been observed again.

Note that TreeItem (Tree parent, int style, int index) does not constrain the allowed range of the index, but still throws an "Index out of bounds" IAE here.
Comment 4 Steve Northover CLA 2006-02-16 20:32:10 EST
From what I can see, someone is calling new TreeItem() with an invalid index and we are throwing an error.  It could be that we have a bug and the index is valid.  Is there something I am missing?

Moving to UI for someone to check AbstractTreeViewer.createTreeItem().
Comment 5 Markus Keller CLA 2006-02-17 05:59:10 EST
Steve, the index cannot be invalid, since the TreeItem constructors don't specify any precondition on the index ;-). I filed bug 128378 for this.
Comment 6 Steve Northover CLA 2006-02-17 09:50:55 EST
Right.
Comment 7 Boris Bokowski CLA 2006-03-08 12:16:42 EST
*** Bug 130517 has been marked as a duplicate of this bug. ***
Comment 8 Boris Bokowski CLA 2006-05-23 14:11:46 EDT
The only idea I have for this one is that a label provider spins the event loop, which runs an asyncExec that changes the tree.  We should protect against this more than we do already, but it would still be good to have a reproducible case.
Comment 9 Tod Creasey CLA 2006-08-16 13:06:25 EDT
Boris if you are not planning to address this for 3.2.1 you should remove the tag. The release candidates start next week.
Comment 10 Boris Bokowski CLA 2006-08-21 13:08:53 EDT
I don't have a reproducible case for this, but I opened a bug for what I think is the general problem.

*** This bug has been marked as a duplicate of 154571 ***