RFR: 8228988: AnnotationParser throws NullPointerException on incompatible member type

Rafael Winterhalter winterhalter at openjdk.java.net
Sun Oct 18 22:31:20 UTC 2020


If an annotation member type is changed in an incompatible manner, the `AnnotationParser` currently throws a
`NullPointerException` if:

- An enumeration-typed member is changed to be an annotation type or a `Class` type.
- An annotation type is changed to be a non-annotation type.

This patch creates `AnnotationTypeMismatchExceptionProxy` to give users a better error message and to delay the
exception to the time where the annotation member is attempted to be accessed.

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

Commit messages:
 - 8228988: AnnotationParser throws NullPointerException on incompatible member type

Changes: https://git.openjdk.java.net/jdk/pull/725/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=725&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8228988
  Stats: 10 lines in 1 file changed: 6 ins; 0 del; 4 mod
  Patch: https://git.openjdk.java.net/jdk/pull/725.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/725/head:pull/725

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


More information about the core-libs-dev mailing list