review request for 8010225 test in typeAnnotations/failures do not test TYPE_USE

Jonathan Gibbons jonathan.gibbons at oracle.com
Fri Aug 30 15:46:05 PDT 2013


On 08/08/2013 05:48 PM, Steve Sides wrote:
> Some changes for JDK-8010225 : test in typeAnnotations/failures do not 
> test TYPE_USE
> Bug: http://bugs.sun.com/view_bug.do?bug_id=8010225
> webrev: http://cr.openjdk.java.net/~ssides/8010225/
>
> This fix is for tl/langtools but since it's all type-annotations test 
> I've posted it here.
>
> -steve


Here's the list of files:

test/tools/javac/annotations/typeAnnotations/failures/AnnotatedImport.java
OK.  Edit is sorta unnecessary, but not wrong.

test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage1.java
OK.  Edit is sorta unnecessary, but not wrong.

test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage2.java
OK.  Edit is sorta unnecessary, but not wrong.

test/tools/javac/annotations/typeAnnotations/failures/AnnotationVersion.java
test/tools/javac/annotations/typeAnnotations/failures/AnnotationVersion.out
test/tools/javac/annotations/typeAnnotations/failures/AnnotationVersion7.out
Test is only negative for 6, 7. Would be better to add positive test 
without -source as well

test/tools/javac/annotations/typeAnnotations/failures/BadCast.java
test/tools/javac/annotations/typeAnnotations/failures/BadCast.out
OK

test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass.java
test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass.out
OK

test/tools/javac/annotations/typeAnnotations/failures/IncompleteArray.java
test/tools/javac/annotations/typeAnnotations/failures/IncompleteArray.out
OK

test/tools/javac/annotations/typeAnnotations/failures/IncompleteVararg.java
test/tools/javac/annotations/typeAnnotations/failures/IncompleteVararg.out
*** There's no varargs in this test, so this test is kinda weird
As it stands, it's sort of a random syntax error test.

test/tools/javac/annotations/typeAnnotations/failures/IndexArray.java
test/tools/javac/annotations/typeAnnotations/failures/IndexArray.out
OK

test/tools/javac/annotations/typeAnnotations/failures/OldArray.java
*** The test passes without changing the golden file. This is unexpected.
The answer is because there is no /ref=...OldArray.out on line 29.
This should be fixed, and then, you'll need to create a golden file!
Also, remove the legal header and substitute /nodynamiccopyright/.

test/tools/javac/annotations/typeAnnotations/failures/Scopes.java
*** You've just removed a space from the line, nothing more.
Did you mean to do more?

test/tools/javac/annotations/typeAnnotations/failures/StaticFields.java
test/tools/javac/annotations/typeAnnotations/failures/StaticFields.out
*** Sorta OK, but not really.  The test runs the risk of  false positive
because f is not itself declared static.  Thus, quite apart from the
annotation, you are trying to do static access to a non-static field,
which is guaranteed to fail.

test/tools/javac/annotations/typeAnnotations/failures/StaticMethods.java
test/tools/javac/annotations/typeAnnotations/failures/StaticMethods.out
This test is kinda pointless because the code fails even without the 
annotation.
i.e. remove the annotation and the test still fails to compile.


More information about the type-annotations-dev mailing list