Created
January 12, 2016 00:24
-
-
Save raphw/3fa7effa486a7ba8b4f0 to your computer and use it in GitHub Desktop.
Type annotations on parameters of multiple type variable bound types are not filtered to their respective bound.
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
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
import java.lang.reflect.AnnotatedParameterizedType; | |
import java.util.List; | |
import java.util.concurrent.Callable; | |
public class Foo<T extends List<@Sample ?> & Callable<@Sample ?>> { | |
public static void main(String[] args) { | |
((AnnotatedParameterizedType) Foo.class.getTypeParameters()[0].getAnnotatedBounds()[0]).getAnnotatedActualTypeArguments(); | |
} | |
} | |
@Retention(RetentionPolicy.RUNTIME) | |
@Target(ElementType.TYPE_USE) | |
@interface Sample { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment