Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313197 - NPE in Table.sendDoubleSelection when double-clicking on the right of an item
Summary: NPE in Table.sendDoubleSelection when double-clicking on the right of an item
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 3.6 RC2   Edit
Assignee: Scott Kovatch CLA
QA Contact: Silenio Quarti CLA
URL:
Whiteboard:
Keywords:
: 342057 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-05-17 13:25 EDT by Markus Keller CLA
Modified: 2011-04-07 09:15 EDT (History)
2 users (show)

See Also:
grant_gayed: review+
Silenio_Quarti: review+


Attachments
Fix (977 bytes, patch)
2010-05-17 18:59 EDT, Scott Kovatch CLA
no flags Details | Diff
Fix with Tree and Table (1.91 KB, patch)
2010-05-17 19:02 EDT, Scott Kovatch CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. ***