Bug 138618 - [project explorer] Hang in navigator when deleting project in "Other Projects"
Summary: [project explorer] Hang in navigator when deleting project in "Other Projects"
Status: CLOSED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 1.0.2   Edit
Hardware: PC Windows XP
: P3 blocker (vote)
Target Milestone: 1.0.3 M103   Edit
Assignee: John Lanuti CLA
QA Contact:
URL:
Whiteboard:
Keywords: greatbug
Depends on:
Blocks:
 
Reported: 2006-04-26 09:37 EDT by John Pitman CLA
Modified: 2006-09-26 11:25 EDT (History)
2 users (show)

See Also:


Attachments
Thread dump for the problem (664.74 KB, text/plain)
2006-04-26 09:55 EDT, John Pitman CLA
no flags Details
proposed patch (2.49 KB, patch)
2006-04-28 11:01 EDT, John Lanuti CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Pitman CLA 2006-04-26 09:37:43 EDT
We are seeing a hang when deleting a project under the "Other Projects" category in the navigator.  It is not 100% reproducible, but it happens very often in our product.

I managed to catch it in the debugger, and it seem that as part of removing the tree item representing the project, setSelectionToWidget is called, which eventually results in a new tree item being created for the deleted project, which the loop in CommonWorkingSetViewer.remove(Object[]) then tries to delete again.

Here is the stack trace from the debugge:

Thread [main] (Evaluating)
	CommonWorkingSetViewer(StructuredViewer).associate(Object, Item) line: 560
	CommonWorkingSetViewer(AbstractTreeViewer).associate(Object, Item) line: 444
	CommonWorkingSetViewer(AbstractTreeViewer).doUpdateItem(Widget, Object, boolean) line: 614
	StructuredViewer$UpdateItemSafeRunnable.run() line: 434
	InternalPlatform.run(ISafeRunnable) line: 1044
	Platform.run(ISafeRunnable) line: 783
	JFaceUtil$1.run(ISafeRunnable) line: 44
	SafeRunnable.run(ISafeRunnable) line: 148
	CommonWorkingSetViewer(StructuredViewer).updateItem(Widget, Object) line: 1763
	CommonWorkingSetViewer(AbstractTreeViewer).createTreeItem(Widget, Object, int) line: 535
	CommonWorkingSetViewer(CommonViewer).createTreeItem(Widget, Object, int) line: 201
	AbstractTreeViewer$1.run() line: 514
	BusyIndicator.showWhile(Display, Runnable) line: 69
	CommonWorkingSetViewer(AbstractTreeViewer).createChildren(Widget) line: 494
	CommonWorkingSetViewer(AbstractTreeViewer).internalExpand(Object, boolean) line: 1076
	CommonWorkingSetViewer(AbstractTreeViewer).setSelectionToWidget(List, boolean) line: 1613
	CommonWorkingSetViewer(StructuredViewer).setSelectionToWidget(ISelection, boolean) line: 1494
	CommonWorkingSetViewer.setSelectionToWidget(ISelection, boolean) line: 343
	CommonWorkingSetViewer(StructuredViewer).preservingSelection(Runnable) line: 1208
	CommonWorkingSetViewer.preservingSelection(Runnable) line: 336
	CommonWorkingSetViewer(AbstractTreeViewer).remove(Object[]) line: 1420
	CommonWorkingSetViewer(CommonViewer).removeWithoutRefresh(Object[]) line: 166
	CommonWorkingSetViewer.remove(Object[]) line: 207
	CommonWorkingSetViewer(AbstractTreeViewer).remove(Object) line: 1442
	DelegateShowProjectContentProvider$3.run() line: 307
	DelegateShowProjectContentProvider$5.run() line: 337
	RunnableLock.run() line: 35
	UISynchronizer(Synchronizer).runAsyncMessages(boolean) line: 123
	Display.runAsyncMessages(boolean) line: 3102
	Display.readAndDispatch() line: 2761
	Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 1699
	Workbench.runUI() line: 1663
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 367
Comment 1 John Pitman CLA 2006-04-26 09:55:50 EDT
Created attachment 39527 [details]
Thread dump for the problem
Comment 2 John Lanuti CLA 2006-04-28 11:01:43 EDT
Created attachment 39778 [details]
proposed patch
Comment 3 John Lanuti CLA 2006-04-28 11:03:50 EDT
Attached proposed patch, which has been tested and verified by the originator. The problem was we were trying to preserve a selection to a widget which was being removed.  So, we detect that the selection is being deleted and do not try to preserve the selection in this case.
Comment 4 Arthur Ryman CLA 2006-05-02 10:54:50 EDT
+1 for WTP 1.0.3 - seems like a very serious bug and worth fixing.
Comment 5 Tim Wagner CLA 2006-05-02 12:32:38 EDT
+1
Comment 6 David Williams CLA 2006-05-09 11:56:33 EDT
+1 (I'm not sure its needed, but the patch does't seem to gaurd for threading issues? So, I'm just asking to re-think in light of threads. If you believe there are none, seems your patch fixes the problem it was intended to. Thanks). 

Comment 7 John Lanuti CLA 2006-05-10 09:43:44 EDT
Patch released for the first WTP 1.0.3 build.

David, I did not view it worthwhile to add any threading specific code as this is a dead base and will be replaced in 1.5 by the eclipse common navigator.  It seemed easiest to fix problem at hand then to risk regressions.
Comment 8 John Lanuti CLA 2006-05-11 10:33:15 EDT
The org.eclipse.jst.common.navigator.java and org.eclipse.jst.web_core.feature plugin version id's have been incremented accordingly.
Comment 9 Jason Sholl CLA 2006-09-26 11:22:16 EDT
verified 20060925
Comment 10 John Lanuti CLA 2006-09-26 11:25:52 EDT
Closing as verified.