Community
Participate
Working Groups
I found an NPE in my console but i don't know how to reproduce it and i have no test case. !ENTRY org.eclipse.jdt.ui 4 0 2005-06-17 17:06:30.296 !MESSAGE Error in JDT Core during reconcile !STACK 0 java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding.genericSignature(TypeVariableBinding.java:271) at org.eclipse.jdt.internal.compiler.lookup.MethodBinding.genericSignature(MethodBinding.java:364) at org.eclipse.jdt.internal.compiler.lookup.MethodBinding.computeUniqueKey(MethodBinding.java:321) at org.eclipse.jdt.internal.compiler.lookup.MethodBinding.computeUniqueKey(MethodBinding.java:310) at org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding.computeUniqueKey(TypeVariableBinding.java:242) at org.eclipse.jdt.internal.compiler.lookup.Binding.computeUniqueKey(Binding.java:45) at org.eclipse.jdt.core.dom.TypeBinding.getKey(TypeBinding.java:455) at org.eclipse.jdt.core.dom.DefaultBindingResolver.resolveTypeParameter(DefaultBindingResolver.java:1399) at org.eclipse.jdt.core.dom.TypeParameter.resolveBinding(TypeParameter.java:201) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2525) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:546) at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:178) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2486) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1162) at org.eclipse.jdt.core.dom.AST.convertCompilationUnit(AST.java:261) at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:84) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:718) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:777) at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1081) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:98) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044) at org.eclipse.core.runtime.Platform.run(Platform.java:783) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:82) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:147) at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:86) at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:94) at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:75) at org.eclipse.jdt.internal.ui.text.JavaReconciler.process(JavaReconciler.java:339) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:204)
Reduced test case (from David) public class X { void bar() throws BinSub { } <T> void foo() { } }
where BinSub is a binary type with missing superclass (manually deleted classfile for supertype in classfolder).
Kent - what about initializing type variable superInterfaces to NoSuperInterfaces when creating them ? We may never get a chance to connect them.
But then, what about other sort of types... maybe null checks are preferrable in various places where it gets used.
We cannot initialize them before since its part of the cycle detection that they are null. I think this case needs a null check.
According to David, an AbortCompilation is thrown, but we catch it in the ASTConverter and still attempt to return a DOM AST with resolved bindings. We might consider not returning bindings at all in this case.
Unfortunately, the AbortCompilation is not caught in the ASTConverter, but in the CompilationUnitProblemFinder (subclass of Compiler). So the best thing we can do is to add a null check.
Created attachment 26299 [details] Null checks added
Created attachment 26300 [details] Regression test
+1 for 3.1.1
Released fix and regression test (renamed to test0197()) in both HEAD and R3_1_maintenance branch.
Verified in I20050920-0010 for 3.2M2
Verified for 3.1.1 using M20050923-1430.