Bug 63748 - Type Hierarchy: null pointer when pressing F4 on ListCellRenderer
Summary: Type Hierarchy: null pointer when pressing F4 on ListCellRenderer
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 RC1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 62414 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-05-24 15:14 EDT by Johan Compagner CLA
Modified: 2004-05-28 15:47 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 Johan Compagner CLA 2004-05-24 15:14:18 EDT
In 3.0M9 i get an null pointer when i want to create/see a type hierarchy of 
the interface ListCellRenderer:

Root exception:
java.lang.NullPointerException
        at 
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.superInterfaces
(BinaryTypeBinding.java:449)
        at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve
(HierarchyResolver.java:679)
        at 
org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.buildForProje
ct(IndexBasedHierarchyBuilder.java:195)
        at 
org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.buildFromPote
ntialSubtypes(IndexBasedHierarchyBuilder.java:302)
        at 
org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.build
(IndexBasedHierarchyBuilder.java:131)
        at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.compute
(TypeHierarchy.java:319)
        at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.refresh
(TypeHierarchy.java:1234)
        at 
org.eclipse.jdt.internal.core.CreateTypeHierarchyOperation.executeOperation
(CreateTypeHierarchyOperation.java:90)
        at org.eclipse.jdt.internal.core.JavaModelOperation.run
(JavaModelOperation.java:700)
        at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation
(JavaModelOperation.java:739)
        at org.eclipse.jdt.internal.core.BinaryType.newTypeHierarchy
(BinaryType.java:690)
        at org.eclipse.jdt.internal.core.BinaryType.newTypeHierarchy
(BinaryType.java:709)
        at org.eclipse.jdt.internal.core.BinaryType.newTypeHierarchy
(BinaryType.java:679)
        at 
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle.createTypeHiera
rchy(TypeHierarchyLifeCycle.java:118)
        at 
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle.doHierarchyRefr
esh(TypeHierarchyLifeCycle.java:157)
        at 
org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle$1.run
(TypeHierarchyLifeCycle.java:98)
        at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:101)
Comment 1 Jerome Lanneluc CLA 2004-05-25 08:13:59 EDT
Johan I cannot reproduce this problem. Would you have more details ?
Comment 2 Johan Compagner CLA 2004-05-25 08:41:03 EDT
hmm i don't do anything special and it happens all the time with my current 
workspace.

I open ListCellRenderer class (CTRL-T) then i select the name and press F4.
I see something in the progress that i builds up. But when it hits lets say 80% 
it comes up with a dialog and and the stacktrace below is in my console window.

with a java.lang.reflect.InvocationTargetException at the top like this:

java.lang.reflect.InvocationTargetException
        at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:283)
        at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.ja
va:576)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)

        at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java
:573)
        at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:1588
)
        at org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle.ensu
reRefreshedTypeHierarchy(TypeHierarchyLifeCycle.java:107)
        at org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyViewPart.updat
eInput(TypeHierarchyViewPart.java:497)
        at org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyViewPart.setIn
putElement(TypeHierarchyViewPart.java:465)
        at org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil.openInViewPart
(OpenTypeHierarchyUtil.java:98)
        at org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil.open(OpenTypeH
ierarchyUtil.java:75)
        at org.eclipse.jdt.ui.actions.OpenTypeHierarchyAction.run(OpenTypeHierar
chyAction.java:176)
        at org.eclipse.jdt.ui.actions.OpenTypeHierarchyAction.run(OpenTypeHierar
chyAction.java:142)
        at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(Select
ionDispatchAction.java:216)
        at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispa
tchAction.java:188)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:881)
        at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:141)

        at org.eclipse.ui.internal.commands.Command.execute(Command.java:132)
        at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(Workben
chKeyboard.java:469)
Comment 3 Jerome Lanneluc CLA 2004-05-25 09:14:14 EDT
Which JRE do you have on your build path ? Do you have other libraries 
(i.e. .jar files) on your build path that contain classes that implement 
ListCellRenderer ?
Comment 4 Johan Compagner CLA 2004-05-25 09:52:26 EDT
jdk1.4.2_04
i do have src implementation besides that. But i don't know if there are other 
jars (besides rt.jar) which also implements or extends that interface. (i can't 
see them :( )

I will try to close all projects besides a small test one that doesn't have 
anything else then the jre of 1.4.2 and then try it again.
Comment 5 Jerome Lanneluc CLA 2004-05-25 10:01:39 EDT
I have the same version of jdk. So the problem must be somewhere else.

To know which classes implement ListCellRenderer you can use Search->Java and 
use javax.swing.ListCellRenderer as the search string, select Type and 
Implementors, press Search. I only have 3 implementors in rt.jar.
Comment 6 Johan Compagner CLA 2004-05-25 10:19:11 EDT
AHA! got it! works again.
It is a jar that has some obfusicated class files that implements the 
ListCellRenderer...

i will attach the jar file.
Comment 7 Jerome Lanneluc CLA 2004-05-26 06:13:31 EDT
*** Bug 62414 has been marked as a duplicate of this bug. ***
Comment 8 Jerome Lanneluc CLA 2004-05-26 06:25:01 EDT
Was able to reproduce with Johan's jar file (sent to me by email). As Johan 
said it contains some class files that are obfusicated, and thus don't follow 
Java conventions (e.g. a$a.class is impossible to contruct in a normal case as 
a member type cannot have the same simple name as its enclosing type).

To workaround this, changed BinaryTypeBinding#cachePartsFrom(IBinaryType, 
boolean) to initialize the superInterfaces field earlier as enclosingType() 
could cause the resolution to abort and we could not use this binding's 
superInterfaces() method later on.

Note it is not possible to write a regression test for this problem as this 
cannot happen in the normal case.
Comment 9 Olivier Thomann CLA 2004-05-28 15:47:33 EDT
Verified in 200405281200 that the fix is in.