RFR[9]: 8147585: Annotations with lambda expressions has parameters result in wrong behavior.

shilpi.rastogi at oracle.com shilpi.rastogi at oracle.com
Mon May 30 06:00:13 UTC 2016


Hi All,

Please review fix for https://bugs.openjdk.java.net/browse/JDK-8147585
http://cr.openjdk.java.net/~srastogi/8147585/webrev.00/

Problem: Annotation with Lamda has parameters results into wrong 
behavior ( not considered as valid annotation) because
  According to JLS "By virtue of the AnnotationTypeElementDeclaration 
production, a method declaration in an annotation type declaration 
cannot have formal parameters, type parameters, or a throws clause. The 
following production from §4.3 is shown here for convenience:"
(Ref: 
https://docs.oracle.com/javase/specs/jls/se8/html/jls-9.html#jls-9.6.1)


Solution: We should skip synthetic methods during Annotation parsing. 
According to JLS "An annotation type has no elements other than those 
defined by the methods it explicitly declares."
(Ref 
https://docs.oracle.com/javase/specs/jls/se8/html/.html#jls-9jls-9.6.1)


Thanks,
Shilpi



More information about the core-libs-dev mailing list