Closed jukzi closed 10 months ago
btw it happend when i tried to get call hierarchy for org.apache.commons.configuration.AbstractFileConfiguration.load(URL)
I see org.eclipse.jdt.internal.compiler.lookup.Scope.enclosingSourceType() can return null
Under one of these conditions:
ClassScope
's referenceContext
has a null
binding
. Either something heavily broken, or this code being invoked too early (i.e., before type bindings are created).so org.eclipse.jdt.internal.compiler.lookup.BlockScope.addLocalType(TypeDeclaration) can create create a SourceTypeBinding with null scope
Where did you see a null scope? I thought you were speaking of a non-null scope with a null SourceTypeBinding as its enclosing.
you might also want to add a Objects.requireNonNull to the constructor of SourceTypeBinding to get an eager fail.
You mean smth like:
public SourceTypeBinding(char[][] compoundName, PackageBinding fPackage, ClassScope scope) {
Objects.requireNonNull(scope);
Not needed, it would already blow up three lines later:
this.fileName = scope.referenceCompilationUnit().getFileName();
If you're able to reproduce, can you call out the offending SourceTypeBinding and method?
you might also want to add a Objects.requireNonNull to the constructor of SourceTypeBinding to get an eager fail.
If this was a comment to the original exception, then you might be interested actually in org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.cleanUp()
:(
i am closing this issue, because i don't know how to reproduce and never had a problem with this error again
Internal Error
I see org.eclipse.jdt.internal.compiler.lookup.Scope.enclosingSourceType() can return null so org.eclipse.jdt.internal.compiler.lookup.BlockScope.addLocalType(TypeDeclaration) can create create a SourceTypeBinding with null scope you might also want to add a Objects.requireNonNull to the constructor of SourceTypeBinding to get an eager fail.