From 48ba3fea26bf31e702199528bd461eaff4cc535c Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 27 Nov 2008 21:30:47 +0000 Subject: 256669: itd parameter annotations copied to target --- tests/bugs163/pr256669/Two.java | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/bugs163/pr256669/Two.java (limited to 'tests/bugs163/pr256669/Two.java') diff --git a/tests/bugs163/pr256669/Two.java b/tests/bugs163/pr256669/Two.java new file mode 100644 index 000000000..795825e51 --- /dev/null +++ b/tests/bugs163/pr256669/Two.java @@ -0,0 +1,31 @@ +import java.lang.reflect.*; +import java.lang.annotation.*; + + +class Destination {} + +aspect Introduction { + // static ITD + public static String Destination.helloWorld(@SomeAnnotation("xyz") String who) { + return "Hello " + who; + } +} + +public class Two { + public static void main(String[] argv) throws Exception { + Class clazz = Destination.class; + Method m = clazz.getMethod("helloWorld", 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 ""; +} -- cgit v1.2.3