diff options
Diffstat (limited to 'tests/bugs163/pr256669/Three.java')
-rw-r--r-- | tests/bugs163/pr256669/Three.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/bugs163/pr256669/Three.java b/tests/bugs163/pr256669/Three.java new file mode 100644 index 000000000..dc487832d --- /dev/null +++ b/tests/bugs163/pr256669/Three.java @@ -0,0 +1,31 @@ +import java.lang.reflect.*; +import java.lang.annotation.*; + + +class Destination {} + +aspect Introduction { + // multiple parameters, not all annotated + public static String Destination.helloWorld(int i, @SomeAnnotation("xyz") String who, long l, @SomeAnnotation("abc") String what) { + return "Hello " + who; + } +} + +public class Three { + public static void main(String[] argv) throws Exception { + Class<Destination> clazz = Destination.class; + Method m = clazz.getMethod("helloWorld", Integer.TYPE,String.class,Long.TYPE,String.class); + Annotation[] ann = m.getAnnotations(); + for (int i = 0; i < m.getParameterAnnotations().length; i++) { + int count = m.getParameterAnnotations()[i].length; + System.out.println("Parameter " + i + " has " + count + " parameter annotations"); + } + + } +} + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +@interface SomeAnnotation { + String value() default ""; +} |