Community
Participate
Working Groups
I20030304 I get the following NPE when debugging using the latest integration build. It mostly happens when clicking on an entry in the vaiable view. This is really annoying since you have to shutdown eclipse when it happens. java.lang.NullPointerException at org.eclipse.jface.viewers.TreeViewer.getExpanded (TreeViewer.java:127) at org.eclipse.jface.viewers.AbstractTreeViewer.internalCollectExpanded (AbstractTreeViewer.java:764) at org.eclipse.jface.viewers.AbstractTreeViewer.getExpandedElements (AbstractTreeViewer.java:527) at org.eclipse.debug.internal.ui.views.ViewerState.saveState (ViewerState.java:38) at org.eclipse.debug.internal.ui.views.ViewerState.<init> (ViewerState.java:28) at org.eclipse.debug.internal.ui.views.variables.VariablesView.setViewerInput (VariablesView.java:350) at org.eclipse.debug.internal.ui.views.variables.VariablesView.selectionChanged (VariablesView.java:1090) at org.eclipse.ui.internal.AbstractPartSelectionTracker$1.run (AbstractPartSelectionTracker.java:105) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:867) at org.eclipse.core.runtime.Platform.run(Platform.java:413) at org.eclipse.ui.internal.AbstractPartSelectionTracker.fireSelection (AbstractPartSelectionTracker.java:103) at org.eclipse.ui.internal.PagePartSelectionTracker$1.selectionChanged (PagePartSelectionTracker.java:32) at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:153) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:867) at org.eclipse.core.runtime.Platform.run(Platform.java:413) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged (Viewer.java:151) at org.eclipse.jface.viewers.StructuredViewer.updateSelection (StructuredViewer.java:1287) at org.eclipse.jface.viewers.StructuredViewer.handleSelect (StructuredViewer.java:654) at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected (StructuredViewer.java:678) at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent (OpenStrategy.java:172) at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:167) at org.eclipse.jface.util.OpenStrategy$1.handleEvent (OpenStrategy.java:302) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1775) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1483) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1268) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1251) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) 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:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:247) at org.eclipse.core.launcher.Main.run(Main.java:703) at org.eclipse.core.launcher.Main.main(Main.java:539)
I don't see how this can happen, since AbstractTreeViewer.internalCollectExpanded just iterates over the items obtained from SWT, passing some of them to getExpanded. Unless Tree.getItems() gets a null in it. I'm wondering if it's a JIT bug. We've seen one recently on IBM 1.3.1 SR2, which was causing an NPE in the Tasks view (this happened in SR1 as well, but apparently more frequently in SR2). Which VM are you using, and have you recently changed?
Actually, the presence of line numbers in the stack trace suggests it's not a JIT problem. Christophe, do you think this could be caused by bug 32734? I guess not since the stacks appear different, and 32734 was fixed for I20030304. Dirk, a reproduceable case here would really help.
The VM I am using java version "1.4.1_01" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01) Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)
Not a duplicate of bug 32734 - which causes a NPE inside SWT It would be really interesting to have a reproduceable case and verify Tree.getItems return a null element.
This could be a variant of bug 4434. Bug 4434 causes an internal call to SWT Tree.getItems to return an array with a null item.
Veronika mentioned that SWT has fixed a similar problem in the variables view. This was in the variables view too.
Fixed. Not in time for RC2.
Fix available in version > v20030307 We have released a fix for a similar problem (bug 4434). It should also fix this problem. Dirk, please reopen if you can reproduce with version > v20030307.