"failures" tests don't necessarily test type annotations

Werner Dietl wdietl at gmail.com
Wed Feb 6 12:11:31 PST 2013

Hi Steve,

thanks for noticing this issue! Yes, the default changed at some point
and maybe not all tests were adapted to this. I probably only
investigated failing tests and updated them.

I just pushed the fix for VoidGenericMethod. Notice how a declaration
annotation wasn't allowed in that particular location, so the test
failed as expected. I moved the annotation to where a declaration
annotation would be legal, to make the distinction clearer. But you
might want to refactor the test to use an expected output file.

Please feel free to update this in other tests or point me to them.

cu, WMD.

On Wed, Feb 6, 2013 at 12:15 PM, Steve Sides <steve.sides at oracle.com> wrote:
> I (just now) noticed that many of the tests in typeAnnotations/failures use
> jdk7 target set and not TYPE_USE.
> /*
>  * @test
>  * @bug 6843077 8006775
>  * @summary test type annotation on void generic methods
>  * @author Mahmood Ali
>  * @compile/fail VoidGenericMethod.java
>  */
> class VoidGenericMethod {
>   public <T> @A void method() { }
> }
> @interface A { }
> For instance, the above from VoidGenericMethod.java says it tests "type
> annotation on void generic methods" but tests a regular annotation.
> I'm guessing these tests were written for a build in which TYPE_USE (and
> TYPE_PARAMETER) were included in the default set(???).
> @Target(TYPE_USE)
> @interface A { }
> So these don't really test negative uses of  type annotations but regular
> uses.
> Shouldn't these be corrected to use type annotations?
> -steve


More information about the type-annotations-dev mailing list