Project: SWT
Bug 388402 List gets into bad state when an item is removed from context menu trigger
Reported: 2012-08-30 05:09:30 | Status: verified fixed

The following NPE may occur in org.eclipse.swt.widgets.Control (in .eclipse.swt.cocoa.macosx.x86_64_3.8.0.v3833.jar) the variable string equals null at this point, please see the stack trace The problem does not seem to occur on Windows -- STACK TRACE copied from Debug View Daemon Thread [Thread-1] (Suspended (breakpoint at line 986 in Control)) List(Control).createString(String, Font, double[], int, boolean, boolean, boolean) line: 986 List.tableView_objectValueForTableColumn_row(long, long, long, long, long) line: 1447 Display.windowProc(long, long, long, long, long) line: 5797 OS.objc_msgSendSuper(objc_super, long, NSRect) line: not available [native method] List(Widget).drawRect(long, long, NSRect) line: 734 Display.windowProc(long, long, long) line: 5471 OS.objc_msgSendSuper(objc_super, long, long, long, long, boolean) line: not available [native method] Display.applicationNextEventMatchingMask(long, long, long, long, long, long) line: 4873 Display.applicationProc(long, long, long, long, long, long) line: 5239 OS.objc_msgSendSuper(objc_super, long, long) line: not available [native method] Table(Widget).callSuper(long, long, long) line: 221 Table(Widget).mouseDownSuper(long, long, long) line: 1093 Table.mouseDownSuper(long, long, long) line: 2004 Table(Widget).mouseDown(long, long, long) line: 1085 Table(Control).mouseDown(long, long, long) line: 2538 Table.mouseDown(long, long, long) line: 1966 Display.windowProc(long, long, long) line: 5493 OS.objc_msgSendSuper(objc_super, long, long) line: not available [native method] Shell(Widget).callSuper(long, long, long) line: 221 Shell(Widget).windowSendEvent(long, long, long) line: 2102 Shell.windowSendEvent(long, long, long) line: 2284 Display.windowProc(long, long, long) line: 5557 OS.objc_msgSendSuper(objc_super, long, long) line: not available [native method] Display.applicationSendEvent(long, long, long) line: 5002 Display.applicationProc(long, long, long) line: 5151 OS.objc_msgSend(long, long, long) line: not available [native method] NSApplication.sendEvent(NSEvent) line: 128 Display.readAndDispatch() line: 3616 Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2701 Workbench.runUI() line: 2665 Workbench.access$4(Workbench) line: 2499 Workbench$7.run() line: 679 Realm.runWithDefault(Realm, Runnable) line: 332 Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 668 PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149 Desk.start(IApplicationContext) line: 174 EclipseAppHandle.run(Object) line: 196 EclipseAppLauncher.runApplication(Object) line: 110 EclipseAppLauncher.start(Object) line: 79 EclipseStarter.run(Object) line: 353 EclipseStarter.run(String[], Runnable) line: 180 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object...) line: 597 Main.invokeFramework(String[], URL[]) line: 629 Main.basicRun(String[]) line: 584 Main.run(String[]) line: 1438 Main.main(String[]) line: 1414 -- STACK TRACE created by Throwable java.lang.NullPointerException at org.eclipse.swt.widgets.Control.createString(Control.java:986) at org.eclipse.swt.widgets.List.tableView_objectValueForTableColumn_row(List.java:1447) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5797) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Widget.drawRect(Widget.java:734) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5471) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Display.applicationNextEventMatchingMask(Display.java:4873) at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5239) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:221) at org.eclipse.swt.widgets.Widget.mouseDownSuper(Widget.java:1093) at org.eclipse.swt.widgets.Table.mouseDownSuper(Table.java:2004) at org.eclipse.swt.widgets.Widget.mouseDown(Widget.java:1085) at org.eclipse.swt.widgets.Control.mouseDown(Control.java:2538) at org.eclipse.swt.widgets.Table.mouseDown(Table.java:1966) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5493) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:221) at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2102) at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2284) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5557) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:5002) at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5151) 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:3616) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at ch.elexis.Desk.start(Desk.java:174) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) at org.eclipse.equinox.launcher.Main.run(Main.java:1438) at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java