The upcoming fix for errors in the positions for tree nodes has uncovered a latent error in the position used to report a duplicate annotation value.
For example, look at test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.java
The standard (non-raw) output is
test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.java:10: duplicate annotation member value value in A
Object a = String @A(value = 2, value = 1) [].class;
^
1 error
(caret under the "1")
With the fixes to 6654037/6919889, the output changes to
test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.java:10: duplicate annotation member value value in A
Object a = String @A(value = 2, value = 1) [].class;
^
1 error
However, this is still not correct -- the correct place for the caret is at the beginning of the second instance of "value".
For example, look at test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.java
The standard (non-raw) output is
test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.java:10: duplicate annotation member value value in A
Object a = String @A(value = 2, value = 1) [].class;
^
1 error
(caret under the "1")
With the fixes to 6654037/6919889, the output changes to
test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.java:10: duplicate annotation member value value in A
Object a = String @A(value = 2, value = 1) [].class;
^
1 error
However, this is still not correct -- the correct place for the caret is at the beginning of the second instance of "value".
- relates to
-
JDK-6654037 JCTree.pos may be incorrect for BinaryTrees
-
- Closed
-
-
JDK-6919889 assorted position errors in compiler syntax trees
-
- Closed
-