RFR: 8268788: Annotations with lambda expressions can still cause AnnotationFormatError

Sergei Ustimenko github.com+5709644+fdesu at openjdk.java.net
Wed Jun 30 20:16:12 UTC 2021


Change #3294 helps to avoid `AnnotaionFormatException` in `sun.reflect.annotation.AnnotationInvocationHandler.validateAnnotationMethods`. While it fixes the case with e.g. `Runnable`  that generates the synthetic method without parameters, validation still fails on synthetic methods that have parameters e.g. `Function`, `BiFunction`, etc.

This change removes the restriction on parameters count to be zero i.e. lambdas with parameters
would be skipped from validation.

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

Commit messages:
 - 8268788: Annotations with lambda expressions can still cause AnnotationFormatError

Changes: https://git.openjdk.java.net/jdk/pull/4642/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4642&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8268788
  Stats: 8 lines in 2 files changed: 5 ins; 1 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4642.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4642/head:pull/4642

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


More information about the core-libs-dev mailing list