Summary: | [1.5][compiler] NPE recompiling in method verifier during annotation cycle detection | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Philipe Mulet <philippe_mulet> | ||||||
Component: | Core | Assignee: | Kent Johnson <kent_johnson> | ||||||
Status: | RESOLVED DUPLICATE | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | frederic_fusier | ||||||
Version: | 3.2 | ||||||||
Target Milestone: | 3.2 M5 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Philipe Mulet
2006-01-17 08:46:04 EST
The null return type feels a consequence of other badness (i.e. problem occurring elsewhere prior to this point). I would expect broken bindings to have been removed, and thus not be reachable in normal cases. Now, this scenario could be a reentrance one. When debugging it, I am finding something strange. During faultInTypes of offending unit (Retention), it thinks the methods have already be resolved, and doesn't redo it, though the return type of the #value() method is still null. public MethodBinding[] methods() { if ((tagBits & TagBits.AreMethodsComplete) != 0) return methods; Looking deeper, it appears we run before into the #methods() invocation, but at a stage where the list of methods is empty (forward ref when resolving annotations). Then later on, we find the bit already set, but a method got inserted. This is what the stack looks when first entering the #methods() call for Retention. SourceTypeBinding.methods() line: 965 SingleMemberAnnotation(Annotation).resolveType(BlockScope) line: 243 ASTNode.resolveAnnotations(BlockScope, Annotation[], Binding) line: 491 SourceTypeBinding.getAnnotationTagBits() line: 646 SingleTypeReference(ASTNode).isTypeUseDeprecated(TypeBinding, Scope) line: 377 SingleTypeReference(TypeReference).resolveType(BlockScope, boolean) line: 134 SingleTypeReference(TypeReference).resolveType(BlockScope) line: 118 SingleMemberAnnotation(Annotation).resolveType(BlockScope) line: 229 ASTNode.resolveAnnotations(BlockScope, Annotation[], Binding) line: 491 SourceTypeBinding.getAnnotationTagBits() line: 646 SingleTypeReference(ASTNode).isTypeUseDeprecated(TypeBinding, Scope) line: 377 SingleTypeReference(TypeReference).resolveType(BlockScope, boolean) line: 134 SingleTypeReference(TypeReference).resolveType(BlockScope) line: 118 MarkerAnnotation(Annotation).resolveType(BlockScope) line: 229 ASTNode.resolveAnnotations(BlockScope, Annotation[], Binding) line: 491 SourceTypeBinding.getAnnotationTagBits() line: 646 SingleTypeReference(ASTNode).isTypeUseDeprecated(TypeBinding, Scope) line: 377 SingleTypeReference(TypeReference).resolveType(BlockScope, boolean) line: 134 SingleTypeReference(TypeReference).resolveType(BlockScope) line: 118 MarkerAnnotation(Annotation).resolveType(BlockScope) line: 229 ASTNode.resolveAnnotations(BlockScope, Annotation[], Binding) line: 491 SourceTypeBinding.getAnnotationTagBits() line: 646 QualifiedTypeReference(ASTNode).isTypeUseDeprecated(TypeBinding, Scope) line: 377 QualifiedTypeReference(TypeReference).resolveType(ClassScope) line: 157 QualifiedTypeReference(TypeReference).resolveSuperType(ClassScope) line: 107 ClassScope.findSupertype(TypeReference) line: 1106 ClassScope.connectSuperclass() line: 766 ClassScope.connectTypeHierarchy() line: 946 CompilationUnitScope.connectTypeHierarchy() line: 278 LookupEnvironment.completeTypeBindings() line: 195 Compiler.beginToCompile(ICompilationUnit[]) line: 304 Compiler.compile(ICompilationUnit[]) line: 318 BatchImageBuilder(AbstractImageBuilder).compile(SourceFile[], SourceFile[]) line: 286 BatchImageBuilder(AbstractImageBuilder).compile(SourceFile[]) line: 251 BatchImageBuilder.build() line: 50 Created attachment 33207 [details]
Intermediate patch
Moved the bound check & deprecation check to deferred stage.
However, in lookup env had to postpone the check until methods got build (if not the offending trace still occurs).
With the patch, however another NPE in lookupEnv occurs on line 190 (first stage of completeTypeBindings !?).
Created attachment 33213 [details]
Slightly better version of the patch
*** Bug 124301 has been marked as a duplicate of this bug. *** |