Last active
January 21, 2016 08:47
-
-
Save raphw/413fe5ce51fdf2f82849 to your computer and use it in GitHub Desktop.
Incorrect resolution of type annotations on nested parameterized type.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Foo { | |
public static void main(String[] args) throws Exception { | |
System.out.println(Arrays.asList(Foo.class.getDeclaredField("bar").getAnnotatedType().getAnnotations())); | |
System.out.println(Arrays.asList(Foo.class.getDeclaredField("qux").getAnnotatedType().getAnnotations())); | |
} | |
GenericNested<Void>.@TypeAnnotation Inner bar; | |
Nested.@TypeAnnotation Inner qux; | |
static class GenericNested<T> { | |
class Inner { } | |
} | |
static class Nested { | |
class Inner { } | |
} | |
@Retention(RetentionPolicy.RUNTIME) | |
@Target(Element.TYPE_USE) | |
@interface TypeAnnotation { } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment