Bug 14192 - NPE restoring TypeHierarchy
Summary: NPE restoring TypeHierarchy
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 normal (vote)
Target Milestone: 2.0 M6   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 14990 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-04-19 00:18 EDT by Nick Edgar CLA
Modified: 2002-05-06 07:53 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2002-04-19 00:18:40 EDT
Build 20020418

After restarting after the deadlock in bug 14191, I did an Open Type.
I got an internal error for the second stack below (both were in the log).

The first one is an error in the hierarchy view restoring itself.
Should check for null input returned from JavaCore.create(elementId) [line 
1214].
No indication in the log for why JavaCore.create returned null.

The second one looks like OpenTypeHierarchyUtil.openInViewPart is not prepared 
to get an ErrorViewPart back.

<log-entry date="Fri Apr 19 00:06:38 EDT 2002">
  <status
     plugin-id="org.eclipse.ui"
     severity="WARNING"
     message="Problems occurred when invoking code from plug-in: 
org.eclipse.ui."
     code="2">
    <exception
       message="null"
       trace="
java.lang.NullPointerException
	at 
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyViewPart.restoreState
(TypeHierarchyViewPart.java:1214)
	at 
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyViewPart.createPartContr
ol(TypeHierarchyViewPart.java:655)
	at org.eclipse.ui.internal.PartPane$1.run(PartPane.java:53)
	at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:782)
	at org.eclipse.core.runtime.Platform.run(Platform.java:411)
	at org.eclipse.ui.internal.PartPane.createChildControl
(PartPane.java:51)
	at org.eclipse.ui.internal.PartPane.createControl(PartPane.java:93)
	at org.eclipse.ui.internal.ViewPane.createControl(ViewPane.java:178)
	at org.eclipse.ui.internal.PartTabFolder.createPartTab
(PartTabFolder.java:245)
	at org.eclipse.ui.internal.PartTabFolder.createControl
(PartTabFolder.java:217)
	at org.eclipse.ui.internal.PartSashContainer.createControl
(PartSashContainer.java:177)
	at org.eclipse.ui.internal.PerspectivePresentation.activate
(PerspectivePresentation.java:89)
	at org.eclipse.ui.internal.Perspective.onActivate(Perspective.java:575)
	at org.eclipse.ui.internal.WorkbenchPage.onActivate
(WorkbenchPage.java:1437)
	at org.eclipse.ui.internal.WorkbenchWindow$6.run
(WorkbenchWindow.java:1068)
	at org.eclipse.swt.custom.BusyIndicator.showWhile
(BusyIndicator.java:56)
	at org.eclipse.ui.internal.WorkbenchWindow.setActivePage
(WorkbenchWindow.java:1055)
	at org.eclipse.ui.internal.WorkbenchWindow.restoreState
(WorkbenchWindow.java:972)
	at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:791)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:638)
	at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:782)
	at org.eclipse.core.runtime.Platform.run(Platform.java:411)
	at org.eclipse.ui.internal.Workbench.openPreviousWorkbenchState
(Workbench.java:616)
	at org.eclipse.ui.internal.Workbench.openWindows(Workbench.java:674)
	at org.eclipse.ui.internal.Workbench.init(Workbench.java:509)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:813)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:643)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:195)
	at org.eclipse.core.launcher.Main.run(Main.java:541)
	at org.eclipse.core.launcher.Main.main(Main.java:396)
">
    </exception>
  </status>
</log-entry>

<log-entry date="Fri Apr 19 00:15:11 EDT 2002">
  <status
     plugin-id="org.eclipse.core.resources"
     severity="INFO"
     message="Unhandled exception caught in event loop."
     code="4">
  </status>
</log-entry>
<log-entry date="Fri Apr 19 00:15:12 EDT 2002">
  <status
     plugin-id="org.eclipse.ui"
     severity="ERROR"
     message="org.eclipse.ui.internal.ViewPane$1$ErrorViewPart"
     code="0">
    <exception
       message="org.eclipse.ui.internal.ViewPane$1$ErrorViewPart"
       trace="
java.lang.ClassCastException: org.eclipse.ui.internal.ViewPane$1$ErrorViewPart
	at 
org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil.openInViewPart
(OpenTypeHierarchyUtil.java:129)
	at org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil.open
(OpenTypeHierarchyUtil.java:105)
	at org.eclipse.jdt.internal.ui.actions.OpenTypeAction.run
(OpenTypeAction.java:59)
	at org.eclipse.jdt.internal.ui.actions.OpenTypeAction.run
(OpenTypeAction.java:76)
	at org.eclipse.ui.internal.PluginAction.runWithEvent
(PluginAction.java:202)
	at org.eclipse.ui.internal.WWinPluginAction.runWithEvent
(WWinPluginAction.java:162)
	at 
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:407)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent
(ActionContributionItem.java:361)
	at org.eclipse.jface.action.ActionContributionItem.access$0
(ActionContributionItem.java:352)
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java:47)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:75)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1412)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1208)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:816)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:643)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:195)
	at org.eclipse.core.launcher.Main.run(Main.java:541)
	at org.eclipse.core.launcher.Main.main(Main.java:396)
">
    </exception>
Comment 1 Nick Edgar CLA 2002-04-19 00:25:09 EDT
Here's a clue for why restore may have failed.
In the workbench.xml was the following memento for the hierarchy view:

- <view id="org.eclipse.jdt.ui.TypeHierarchy">
  <viewState hidefields="false" hidenonpublic="false" hidestatic="false" 
input="=org.eclipse.jdt.ui/ui<org.eclipse.jdt.internal.ui.dialogs
{TwoPaneElementSelector.java[TwoPaneElementSelector" mv_vertical_scroll="0" 
orientation="0" ratio="350" 
selection="=org.eclipse.jdt.junit//org.eclipse.jdt.junit/junitsupport.jar<org.e
clipse.jdt.internal.junit.launcher(TestSelectionDialog.class
[TestSelectionDialog" showinherited="false" vertical_scroll="0" view="2" /> 
  </view>

It refers to TwoPaneElementSelector.java which I had been working on last 
night (with JDT UI source in my workspace).
As bug 14191 describes, tonight I had imported all projects as binary except 
for org.eclipse.ui, so this overwrote JDT UI.  Eclipse then crashed.
So, on subsequent restore, the CU referred to by the memento no longer existed 
in the workspace.
Comment 2 Erich Gamma CLA 2002-04-19 05:10:48 EDT
restoring from a memento has to handle the case that an element stored in the 
memento no longer exists. I will check in our other views as well.
Comment 3 Erich Gamma CLA 2002-04-19 05:11:30 EDT
Packages view has a similar problem and it will result in null elements in the 
selection. Martin please move bug back to inbox when done.
Comment 4 Martin Aeschlimann CLA 2002-04-19 06:12:11 EDT
fixed in TypeHierarchyViewPart > 20020418

Comment 5 Martin Aeschlimann CLA 2002-05-03 03:40:24 EDT
*** Bug 14990 has been marked as a duplicate of this bug. ***
Comment 6 Erich Gamma CLA 2002-05-05 10:15:02 EDT
fixed packages view.

Dani pls check the Java Browsing views.
Comment 7 Dani Megert CLA 2002-05-06 06:19:47 EDT
Ok for Java Browsing views.
Closing the BR.