Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339345 - ClassCast exception when drop target is List
Summary: ClassCast exception when drop target is List
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 3.7 M6   Edit
Assignee: Lakshmi P Shanmugam CLA
QA Contact: Silenio Quarti CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-09 07:54 EST by Lakshmi P Shanmugam CLA
Modified: 2011-03-09 11:59 EST (History)
0 users

See Also:


Attachments
patch (1.66 KB, patch)
2011-03-09 07:56 EST, Lakshmi P Shanmugam CLA
no flags Details | Diff
fix (2.04 KB, patch)
2011-03-09 11:56 EST, Silenio Quarti CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lakshmi P Shanmugam CLA 2011-03-09 07:54:44 EST
Happens on Cocoa with 3.7 HEAD

Run the DNDExample. Drag and drop to a the List as drop target.
We get class cast exception.

Exception in thread "main" java.lang.ClassCastException: org.eclipse.swt.widgets.List cannot be cast to org.eclipse.swt.widgets.Table
	at org.eclipse.swt.dnd.DropTarget.tableView_validateDrop_proposedRow_proposedDropOperation(DropTarget.java:965)
	at org.eclipse.swt.dnd.DropTarget.dropTargetProc(DropTarget.java:475)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.dnd.DropTarget.dndCallSuper(DropTarget.java:208)
	at org.eclipse.swt.dnd.DropTarget.draggingEntered(DropTarget.java:270)
	at org.eclipse.swt.dnd.DropTarget.dropTargetProc(DropTarget.java:448)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
	at org.eclipse.swt.widgets.Widget.mouseDownSuper(Widget.java:1081)
	at org.eclipse.swt.widgets.Table.mouseDownSuper(Table.java:1979)
	at org.eclipse.swt.widgets.Widget.mouseDown(Widget.java:1073)
	at org.eclipse.swt.widgets.Control.mouseDown(Control.java:2494)
	at org.eclipse.swt.widgets.Table.mouseDown(Table.java:1951)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5453)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
	at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2082)
	at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2243)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5517)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4971)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5120)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3596)
	at org.eclipse.swt.examples.dnd.DNDExample.open(DNDExample.java:1352)
	at org.eclipse.swt.examples.dnd.DNDExample.main(DNDExample.java:71)
Comment 1 Lakshmi P Shanmugam CLA 2011-03-09 07:56:03 EST
Created attachment 190750 [details]
patch
Comment 2 Lakshmi P Shanmugam CLA 2011-03-09 08:11:49 EST
Fix for Bug 335172 missed out the check before type-casting.
The drop feedback doesn't work for List currently, but that seems like a different bug. (Need to investigate further...)
Silenio, can you please review for M6?
Comment 3 Silenio Quarti CLA 2011-03-09 11:56:34 EST
Created attachment 190775 [details]
fix

This patch uses OS calls to do the work. No need to cast.
Comment 4 Silenio Quarti CLA 2011-03-09 11:59:04 EST
Fixed > 20110309.

Lakshmi, please give it a try.