Bug 40241 - NullPointerException in search for hierachy
Summary: NullPointerException in search for hierachy
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M6   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-16 12:38 EDT by Stephan Frind CLA
Modified: 2003-12-08 12:12 EST (History)
1 user (show)

See Also:


Attachments
Use case for demonstrating issue - happens on upgrade from 2.1.0 to 2.1.1 (1.05 KB, text/plain)
2003-10-31 13:51 EST, Shankar Venkataraman CLA
no flags Details
Test Project to demonstrate use case described in comment #14 (27.78 KB, application/x-zip-compressed)
2003-11-12 12:39 EST, Shankar Venkataraman CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Frind CLA 2003-07-16 12:38:58 EDT
I have tried to open hierarchy on java.util.Iterator.

!ENTRY org.eclipse.jdt.ui 4 10001 Jul 16, 2003 18:25:49.604
!MESSAGE Internal Error
!STACK 0
java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:283)
	at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:431)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
	at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:428)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:1385)
	at
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle.ensureRefreshedTypeHierarchy(TypeHierarchyLifeCycle.java:122)
	at
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyViewPart.updateInput(TypeHierarchyViewPart.java:468)
	at
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyViewPart.setInputElement(TypeHierarchyViewPart.java:449)
	at
org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil.openInViewPart(OpenTypeHierarchyUtil.java:94)
	at
org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil.open(OpenTypeHierarchyUtil.java:75)
	at
org.eclipse.jdt.ui.actions.OpenTypeHierarchyAction.run(OpenTypeHierarchyAction.java:175)
	at
org.eclipse.jdt.ui.actions.OpenTypeHierarchyAction.run(OpenTypeHierarchyAction.java:141)
	at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:193)
	at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:169)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:842)
	at
org.eclipse.ui.internal.WWinKeyBindingService.pressed(WWinKeyBindingService.java:214)
	at
org.eclipse.ui.internal.WWinKeyBindingService$5.widgetSelected(WWinKeyBindingService.java:332)
	at org.eclipse.ui.internal.AcceleratorMenu$2.handleEvent(AcceleratorMenu.java:68)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1838)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1545)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
	at
org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858)
	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:291)
	at org.eclipse.core.launcher.Main.run(Main.java:747)
	at org.eclipse.core.launcher.Main.main(Main.java:583)
Caused by: java.lang.NullPointerException
	at
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.superInterfaces(BinaryTypeBinding.java:433)
	at
org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.remember(HierarchyResolver.java:290)
	at
org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.accept(HierarchyResolver.java:140)
	at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:74)
	at
org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:29)
	at
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.enclosingType(BinaryTypeBinding.java:273)
	at
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.cachePartsFrom(BinaryTypeBinding.java:112)
	at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:304)
	at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:287)
	at
org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.accept(HierarchyResolver.java:138)
	at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:74)
	at
org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:29)
	at
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.superclass(BinaryTypeBinding.java:427)
	at
org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.remember(HierarchyResolver.java:289)
	at
org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:442)
	at
org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.buildForProject(IndexBasedHierarchyBuilder.java:230)
	at
org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.buildFromPotentialSubtypes(IndexBasedHierarchyBuilder.java:323)
	at
org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.build(IndexBasedHierarchyBuilder.java:165)
	at
org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.compute(TypeHierarchy.java:322)
	at
org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.refresh(TypeHierarchy.java:1368)
	at
org.eclipse.jdt.internal.core.CreateTypeHierarchyOperation.executeOperation(CreateTypeHierarchyOperation.java:78)
	at
org.eclipse.jdt.internal.core.JavaModelOperation.execute(JavaModelOperation.java:365)
	at
org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:684)
	at org.eclipse.jdt.internal.core.JavaElement.runOperation(JavaElement.java:540)
	at org.eclipse.jdt.internal.core.BinaryType.newTypeHierarchy(BinaryType.java:476)
	at org.eclipse.jdt.internal.core.BinaryType.newTypeHierarchy(BinaryType.java:465)
	at
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle.doHierarchyRefresh(TypeHierarchyLifeCycle.java:141)
	at
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle.access$0(TypeHierarchyLifeCycle.java:127)
	at
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle$1.run(TypeHierarchyLifeCycle.java:115)
	at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)
Comment 1 Dirk Baeumer CLA 2003-07-17 03:59:38 EDT
The NPE happens in 
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.superInterfaces
(BinaryTypeBinding.java:433)


Moving to Core.
Comment 2 Jerome Lanneluc CLA 2003-08-29 10:06:13 EDT
Which build were you using? Can you reproduce with 3.0M3?
Comment 3 Jerome Lanneluc CLA 2003-09-11 07:14:35 EDT
Please reopen when you have more information.
Comment 4 Shankar Venkataraman CLA 2003-10-31 13:51:44 EST
Created attachment 6627 [details]
Use case for demonstrating issue - happens on upgrade from 2.1.0 to 2.1.1
Comment 5 Jerome Lanneluc CLA 2003-11-03 06:24:51 EST
Reopening for investigation
Comment 6 Jerome Lanneluc CLA 2003-11-04 09:24:53 EST
Shankar, in step 13, how do you open MultipageEditor.java? From step 12, the 
workspace must be empty. Or do you start the same workspace that was saved in 
step 9?
Comment 7 Jerome Lanneluc CLA 2003-11-04 09:26:49 EST
Shankar, you were not on the CC list. I added yourself. Can you please see 
comment #6?
Comment 8 Shankar Venkataraman CLA 2003-11-04 12:10:38 EST
I forgot a step in my use case. After step 8, do the following:

8a. Go to the navigator view, and create a working set with the Multipage 
editor project you created just now.

Then after Step 12, invoke the plugin development perspective, switch to the 
navigator view and open the file MultipageEditor.java.

Sorry about the oversight.
Comment 9 Shankar Venkataraman CLA 2003-11-04 12:16:39 EST
One more clarification for the previous comment. The action after step 12 
should be as follows:

After Step 12, invoke the plugin development perspective, switch to the 
navigator view, select the working set to the one that was created in step 8, 
and open the file MultipageEditor.java.


Comment 10 Jerome Lanneluc CLA 2003-11-05 06:39:50 EST
So in step 11 do you start the workspace that was saved in step 9?
Comment 11 Shankar Venkataraman CLA 2003-11-05 11:48:01 EST
Yes. I start the workspace in step 11, that was saved in step 9.
Comment 12 Shankar Venkataraman CLA 2003-11-11 16:22:36 EST
Any updates - I am pretty constrained due to this issue.
Comment 13 Jerome Lanneluc CLA 2003-11-12 09:02:44 EST
Sorry but I still cannot reproduce with the given steps. 
Note these steps seems to not be accurate enough. For example, in step 11 if 
you start the workspace saved in step 9, then in step 13, you don't need to 
invoke the plugin development perspective.

I'm not sure what I can do without accurate steps.
Comment 14 Shankar Venkataraman CLA 2003-11-12 12:19:49 EST
I am able to get this problem even on a fresh project created in 2.1.2. I did 
the following:

1. Create a new plugin development project that uses a multi page editor.

2. Open the file MultipageEditor.java that was autocreated by the wizard.

3. Right click on MultiPageEditorPart, choose Open Type Hierarchy, and ensure 
you are able to see the hierarchy.

4.Highlight the word EditorPart in the file 
org.eclipse.ui.part.MultiPageEditorPart that is open as a result of the 
previous step, right click and choose Open Type Hierarchy.

5. You will get the following exception trace.


java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:283)
	at org.eclipse.jface.window.ApplicationWindow$1.run
(ApplicationWindow.java:431)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
	at org.eclipse.jface.window.ApplicationWindow.run
(ApplicationWindow.java:428)
	at org.eclipse.ui.internal.WorkbenchWindow.run
(WorkbenchWindow.java:1385)
	at 
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle.ensureRefreshed
TypeHierarchy(TypeHierarchyLifeCycle.java:122)
	at 
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyViewPart.updateInput
(TypeHierarchyViewPart.java:468)
	at 
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyViewPart.setInputElement
(TypeHierarchyViewPart.java:449)
	at org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil.openInViewPart
(OpenTypeHierarchyUtil.java:94)
	at org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil.open
(OpenTypeHierarchyUtil.java:75)
	at org.eclipse.jdt.ui.actions.OpenTypeHierarchyAction.run
(OpenTypeHierarchyAction.java:175)
	at org.eclipse.jdt.ui.actions.OpenTypeHierarchyAction.run
(OpenTypeHierarchyAction.java:141)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun
(SelectionDispatchAction.java:193)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run
(SelectionDispatchAction.java:169)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:842)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:456)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent
(ActionContributionItem.java:403)
	at org.eclipse.jface.action.ActionContributionItem.access$0
(ActionContributionItem.java:397)
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java:72)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2022)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1729)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:858)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
	at org.eclipse.core.launcher.Main.run(Main.java:747)
	at org.eclipse.core.launcher.Main.main(Main.java:583)
Caused by: java.lang.NullPointerException
	at 
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.superInterfaces
(BinaryTypeBinding.java:433)
	at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.remember
(HierarchyResolver.java:290)
	at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.accept
(HierarchyResolver.java:140)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType
(LookupEnvironment.java:74)
	at 
org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve
(UnresolvedReferenceBinding.java:29)
	at 
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.enclosingType
(BinaryTypeBinding.java:273)
	at 
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.cachePartsFrom
(BinaryTypeBinding.java:112)
	at 
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom
(LookupEnvironment.java:304)
	at 
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom
(LookupEnvironment.java:287)
	at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.accept
(HierarchyResolver.java:138)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType
(LookupEnvironment.java:74)
	at 
org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve
(UnresolvedReferenceBinding.java:29)
	at 
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.enclosingType
(BinaryTypeBinding.java:273)
	at 
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.cachePartsFrom
(BinaryTypeBinding.java:112)
	at 
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom
(LookupEnvironment.java:304)
	at 
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.cacheBinaryType
(LookupEnvironment.java:145)
	at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve
(HierarchyResolver.java:430)
	at 
org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.buildForProje
ct(IndexBasedHierarchyBuilder.java:230)
	at 
org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.buildFromPote
ntialSubtypes(IndexBasedHierarchyBuilder.java:323)
	at 
org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.build
(IndexBasedHierarchyBuilder.java:165)
	at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.compute
(TypeHierarchy.java:322)
	at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.refresh
(TypeHierarchy.java:1368)
	at 
org.eclipse.jdt.internal.core.CreateTypeHierarchyOperation.executeOperation
(CreateTypeHierarchyOperation.java:78)
	at org.eclipse.jdt.internal.core.JavaModelOperation.execute
(JavaModelOperation.java:365)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run
(JavaModelOperation.java:684)
	at org.eclipse.jdt.internal.core.JavaElement.runOperation
(JavaElement.java:540)
	at org.eclipse.jdt.internal.core.BinaryType.newTypeHierarchy
(BinaryType.java:476)
	at org.eclipse.jdt.internal.core.BinaryType.newTypeHierarchy
(BinaryType.java:465)
	at 
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle.doHierarchyRefr
esh(TypeHierarchyLifeCycle.java:141)
	at 
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle.access$0
(TypeHierarchyLifeCycle.java:127)
	at 
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle$1.run
(TypeHierarchyLifeCycle.java:115)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:101)
Comment 15 Shankar Venkataraman CLA 2003-11-12 12:39:21 EST
Created attachment 6752 [details]
Test Project to demonstrate use case described in comment #14

This is the test project that I created to repro the issue with the steps in
comment #14.
Comment 16 Jerome Lanneluc CLA 2003-11-12 12:54:37 EST
Sorry still no luck reproducing it.

From your test project, I see that you have other projects in your workspace 
which might interfer with the hierarchy computing. Could you please try a fresh 
workspace?
Comment 17 Shankar Venkataraman CLA 2003-11-12 13:15:23 EST
I am unable to repro with a different workspace. Any clues on fixing up my 
workspace? Or do I Export my project and switch to a new workspace?
Comment 18 Jerome Lanneluc CLA 2003-11-13 01:45:54 EST
If I knew what causes the problem in your workspace, I would know how to fix 
it :-) Sorry except exporting your project to a new workspace, I don't see any 
other solution.
Comment 19 Jerome Lanneluc CLA 2003-12-08 11:17:28 EST
Can this be closed?
Comment 20 Shankar Venkataraman CLA 2003-12-08 12:08:17 EST
Yes, it can be closed. The workaround is to move any existing projects into a 
new workspace and everything works fine.
Comment 21 Jerome Lanneluc CLA 2003-12-08 12:12:43 EST
Thanks. Closing then.