RFR 6388543: improve accuracy of source positions for AnnotationValue param of Messager.printMessage

Joseph D. Darcy joe.darcy at oracle.com
Wed Jan 4 00:41:03 UTC 2017


While not a review, since the API was designed to support the more 
precise message reporting, it would be good to see that functionality 
present in javac.

Thanks,

-Joe

On 1/3/2017 1:21 PM, Liam Miller-Cushon wrote:
> Hello,
>
> The JavacMessager API allows a message to be generated for a source 
> position defined by a combination of Element + AnnotationMirror + 
> AnnotationValue. The AnnotationValue is currently ignored, and the 
> position is defined using only the Element and AnnotationMirror.
>
> This fix causes the AnnotationValue to be considered when calculating 
> the diagnostic position. The value must be a direct value of the given 
> annotation, or an element in an array initializer. Values of nested 
> annotation mirrors are not supported.
>
> For example, given `@A(x = {1}, y = @B(2))` positions will be 
> calculated for the AnnotationMirror + AnnotationValue pairs @A + {1}, 
> @A + 1, and @B + 2, but not for @A + 2.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-6388543
> Webrev: http://cr.openjdk.java.net/~cushon/6388543/webrev.00/ 
> <http://cr.openjdk.java.net/%7Ecushon/6388543/webrev.00/>



More information about the compiler-dev mailing list