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

Liam Miller-Cushon cushon at google.com
Tue Jan 3 21:21:31 UTC 2017


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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20170103/ffc91cf6/attachment-0001.html>


More information about the compiler-dev mailing list