Bug 72094 - NPE inside qualified type reference resolution
Summary: NPE inside qualified type reference resolution
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 M2   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 69281 73262 73505 73628 73706 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-08-17 10:47 EDT by David Audel CLA
Modified: 2004-09-24 04:26 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Audel CLA 2004-08-17 10:47:05 EDT
build I20040812

1) create X.java
public class X {
}
2) create Y.java
public class Y {
}
3) change X.java content
public class X extends Y.Z {
}
4) save (ctrl + s)

NPE occurs

java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.lookup.Scope.findMemberType
(Scope.java:669)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getMemberType
(Scope.java:1697)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getType
(Scope.java:1809)
	at 
org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference.getTypeBinding
(QualifiedTypeReference.java:41)
	at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType
(TypeReference.java:147)
	at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveSuperType
(TypeReference.java:100)
	at org.eclipse.jdt.internal.compiler.lookup.ClassScope.findSupertype
(ClassScope.java:924)
	at org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectSuperclass
(ClassScope.java:636)
	at 
org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectTypeHierarchy
(ClassScope.java:739)
	at 
org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarc
hy(CompilationUnitScope.java:239)
	at 
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings
(LookupEnvironment.java:183)
	at org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:552)
	at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process
(CompilationUnitProblemFinder.java:175)
	at org.eclipse.jdt.internal.core.CompilationUnit.buildStructure
(CompilationUnit.java:148)
	at org.eclipse.jdt.internal.core.Openable.generateInfos
(Openable.java:183)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed
(JavaElement.java:543)
	at org.eclipse.jdt.internal.core.CompilationUnit.makeConsistent
(CompilationUnit.java:979)
	at 
org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation
(ReconcileWorkingCopyOperation.java:58)
	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.CompilationUnit.reconcile
(CompilationUnit.java:1100)
	at org.eclipse.jdt.internal.core.CompilationUnit.reconcile
(CompilationUnit.java:1063)
	at 
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.commitWor
kingCopy(CompilationUnitDocumentProvider.java:886)
	at ...
Comment 1 Kent Johnson CLA 2004-08-17 16:31:34 EDT
This is due to the reference changes. We no longer eagerly resolve the 
hierarchy of the type Y, so it doesn't know its interfaces when we look for Z.
Comment 2 Kent Johnson CLA 2004-08-17 16:48:46 EDT
Actually I was wrong.

This fails now (it doesn't fail in 3.0.1) because we added resolveSuperType().

We must detectCycles on each resolved type of the QualifiedTypeRef before 
resolving the next word.
Comment 3 Kent Johnson CLA 2004-08-26 11:17:35 EDT
Reworked the resolveType of all TypeReferences to detect cycles.

ClassScope.findSuperType now expects cycles to be detected in the call to 
resolveSuperType.

See changes to GenericTypeTest.test112
Comment 4 Kent Johnson CLA 2004-09-06 14:28:34 EDT
*** Bug 73262 has been marked as a duplicate of this bug. ***
Comment 5 Kent Johnson CLA 2004-09-09 04:47:27 EDT
*** Bug 73505 has been marked as a duplicate of this bug. ***
Comment 6 Kent Johnson CLA 2004-09-09 04:49:43 EDT
*** Bug 69281 has been marked as a duplicate of this bug. ***
Comment 7 Kent Johnson CLA 2004-09-10 16:45:29 EDT
*** Bug 73706 has been marked as a duplicate of this bug. ***
Comment 8 Kent Johnson CLA 2004-09-13 16:30:28 EDT
*** Bug 73628 has been marked as a duplicate of this bug. ***
Comment 9 Frederic Fusier CLA 2004-09-24 04:26:26 EDT
Verified for 3.1 M2 with build I200409231635.