Community
Participate
Working Groups
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)
Johan I cannot reproduce this problem. Would you have more details ?
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)
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 ?
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.
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.
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.
*** Bug 62414 has been marked as a duplicate of this bug. ***
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.
Verified in 200405281200 that the fix is in.