| Summary: | DND actions in AbstractTreeViewer lead to NPE and application freeze [Carbon] | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | <h1055071> | ||||||||
| Component: | SWT | Assignee: | Lakshmi P Shanmugam <lshanmug> | ||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||
| Severity: | major | ||||||||||
| Priority: | P3 | CC: | eclipse.felipe, masgui, remy.suen, Silenio_Quarti | ||||||||
| Version: | 3.6.2 | Flags: | Silenio_Quarti:
review+
eclipse.felipe: review+ lshanmug: review? (eclipse.felipe) |
||||||||
| Target Milestone: | 3.7 RC2 | ||||||||||
| Hardware: | Macintosh | ||||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Created attachment 192551 [details]
Stack Trace log
Add the Stack trace
I managed a workaround in my RCP application by wrapping the code that handles the Drop event in a Display.asyncExec() thread. I wonder if this is a regression introduced by an Apple Java update. NOTE - this is only happening on Mac Carbon, Cocoa is fine. This problem is occurring in OS X versions 10.6.4 and 10.6.6 and on Java versions 1.6.0_20 and 1.6.0_24. I have done some testing with different version of the Eclipse Carbon Mac version. It seems that this regression was introduced in version 3.6.1 as it does not occur in version 3.6.0. Here are the steps to reproduce using Eclipse Mac Carbon SDK 3.6.1 or 3.6.2: 1. Create a General Project "Foo". 2. In Package Explorer, add two folders under the project node, "Folder1" and "Folder2" 3. Create a new text file, "File.txt" in Folder1. 4. In Package Explorer, drag File.txt from Folder1 to Folder2. All will seem to be well...but now try to drag it back again. There will be a freeze. Check the Eclipse error log, you will see a NPE. Or, put simply, drag and drop is screwed in the Carbon version of Eclipse. I think it may be something to do with the order of events? I guess this won't be fixed then. This was caused by the changes for bug#243529. Lakshmi, please investigate it. Created attachment 195498 [details]
snippet to reproduce bug
This happens when the TreeItem is disposed inside DropTargetListener.drop(). After this Tree.getSelectionCount() returns a wrong value and Tree.getSelection() returns items array with null.
I'm investigating this.
Created attachment 195535 [details]
patch
When a selected TreeItem is disposed, OS.kDataBrowserItemDeselected message is sent to the Tree. But, since the DRAG_STARTED is set in the control's data, we are selecting the disposed item. The DRAG_STARTED in control's data is cleared only when drag finishes.
The patch resets DRAG_STARTED to null in dragSendDataProc() itself. Tested with the example snippet & Package explorer in the IDE. The patch fixes problem for Table too.
Silenio, can you please review?
Hi Felipe, can you please review for RC2? Fixed in HEAD > 20110516. Thanks Silenio & Felipe! *** Bug 329625 has been marked as a duplicate of this bug. *** |