Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313197

Summary: NPE in Table.sendDoubleSelection when double-clicking on the right of an item
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: SWTAssignee: Scott Kovatch <skovatch>
Status: RESOLVED FIXED QA Contact: Silenio Quarti <Silenio_Quarti>
Severity: normal    
Priority: P3 CC: n.a.edgar, skovatch
Version: 3.6Flags: grant_gayed: review+
Silenio_Quarti: review+
Target Milestone: 3.6 RC2   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
Fix
none
Fix with Tree and Table none

Description Markus Keller CLA 2010-05-17 13:25:59 EDT
HEAD, Cocoa

- run Snippet113, which creates a Table with SWT.CHECK style
- double-click on the right of an item (not in the item text)
=> NPE

Exception in thread "main" java.lang.NullPointerException
	at org.eclipse.swt.widgets.Table.sendDoubleSelection(Table.java:2975)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4957)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:237)
	at org.eclipse.swt.widgets.Widget.mouseDownSuper(Widget.java:1060)
	at org.eclipse.swt.widgets.Table.mouseDownSuper(Table.java:1930)
	at org.eclipse.swt.widgets.Widget.mouseDown(Widget.java:1056)
	at org.eclipse.swt.widgets.Control.mouseDown(Control.java:2305)
	at org.eclipse.swt.widgets.Table.mouseDown(Table.java:1912)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5099)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:237)
	at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:1978)
	at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2007)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5163)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4705)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:4782)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:115)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3399)
	at org.eclipse.swt.snippets.Snippet113.main(Snippet113.java:42)
Comment 1 Scott Kovatch CLA 2010-05-17 18:59:00 EDT
Created attachment 168837 [details]
Fix

Fix is simple -- make sure clickedColumn() isn't -1 before testing against the checkColumn.
Comment 2 Scott Kovatch CLA 2010-05-17 19:02:11 EDT
This is a candidate for 3.6rc2, since it's an NPE in an easy-to-reproduce case.
Comment 3 Scott Kovatch CLA 2010-05-17 19:02:46 EDT
Created attachment 168838 [details]
Fix with Tree and Table

Fix applies to Tree as well.
Comment 4 Grant Gayed CLA 2010-05-18 10:07:07 EDT
The patch looks fine, and there aren't any other senders of clickedColumn(), so there aren't other obvious places where this would happen.
Comment 5 Scott Kovatch CLA 2010-05-18 12:46:55 EDT
Fixed > 20100518.
Comment 6 Lakshmi P Shanmugam CLA 2011-04-07 09:15:56 EDT
*** Bug 342057 has been marked as a duplicate of this bug. ***