Project: SWT
Bug 127095 NPE when trying to dispose columns
Reported: 2006-02-09 11:19:21 | Status: resolved fixed

Memory View allows user to change the number of columns in a table. This is done by disposing the columns and recreating them. Got the following NPE when trying to reformat. java.lang.NullPointerException at org.eclipse.swt.widgets.TableItem.removeColumn(TableItem.java:1155) at org.eclipse.swt.widgets.Table.destroyItem(Table.java:612) at org.eclipse.swt.widgets.TableColumn.dispose(TableColumn.java:267) at org.eclipse.swt.widgets.TableColumn.dispose(TableColumn.java:244) at org.eclipse.debug.internal.ui.views.memory.renderings.AsyncVirtualContentTableViewer.disposeColumns(AsyncVirtualContentTableViewer.java:98) at org.eclipse.debug.internal.ui.views.memory.renderings.AbstractAsyncTableRendering.formatViewer(AbstractAsyncTableRendering.java:1258) at org.eclipse.debug.internal.ui.views.memory.renderings.AbstractAsyncTableRendering.format(AbstractAsyncTableRendering.java:1014) at org.eclipse.debug.internal.ui.views.memory.renderings.FormatTableRenderingAction.run(FormatTableRenderingAction.java:44) at org.eclipse.jface.action.Action.runWithEvent(Action.java:492) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:530) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:480) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:392) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:775) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3059) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2748) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1793) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1757) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:402) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:106) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:109) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:374) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:615) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:338) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/TableItem.java bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/TreeItem.java