eclipse-jdt / eclipse-jdt/eclipse.jdt.core

BindingKeyResolver.consumeAnnotation() should expect null array elements

Open
#2,806 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 12h
Merged PRs (30d)
47

Description

While checking #2804 I realize that generally callers of `org.eclipse.jdt.internal.compiler.lookup.MethodBinding.getAnnotations()` do expect the resulting array to contain nulls.

I could find only one exception: `BindingKeyResolver.consumeAnnotation()` which could probably throw NPE when an annotation could not be resolved. Most likely this can be triggered via `org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(ICompilationUnit[], String[], ASTRequestor, int, Map, IJavaProject, WorkingCopyOwner, int, IProgressMonitor)` when passing a binding key for a method which contains an annotation (perhaps the key was obtained while the annotation type was still present).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.