Integrated: 8228988: AnnotationParser throws NullPointerException on incompatible member type

Rafael Winterhalter winterhalter at openjdk.java.net
Tue Apr 20 21:36:30 UTC 2021


On Fri, 5 Feb 2021 21:24:34 GMT, Rafael Winterhalter <winterhalter at openjdk.org> wrote:

> When a class is compiled against a version of an annotation that is later loaded in an incompatible manner where an enum-typed member is changed into an annotation or vice versa, the reflection API currently throws a `NullPointerException` upon accessing the member. Instead an `AnnotationTypeMismatchException` should be thrown.
> 
> This change adjusts the parsing to trigger the correct exception.

This pull request has now been integrated.

Changeset: f47faf28
Author:    Rafael Winterhalter <winterhalter at openjdk.org>
Committer: Joe Darcy <darcy at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/f47faf28
Stats:     182 lines in 3 files changed: 178 ins; 0 del; 4 mod

8228988: AnnotationParser throws NullPointerException on incompatible member type

Reviewed-by: darcy

-------------

PR: https://git.openjdk.java.net/jdk/pull/2439


More information about the core-libs-dev mailing list