diff options
author | acolyer <acolyer> | 2005-09-21 15:05:28 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-09-21 15:05:28 +0000 |
commit | 4895aeff9da732f0f6f498158e09921844a5a792 (patch) | |
tree | 30e60b63f996a1a81637bd48c35454f8a9828633 | |
parent | 5f93dd1b209827833813978a860dcf1a95b20197 (diff) | |
download | aspectj-4895aeff9da732f0f6f498158e09921844a5a792.tar.gz aspectj-4895aeff9da732f0f6f498158e09921844a5a792.zip |
test for annotation binding bug when target type in bytecode != declaring type (1.4)
-rw-r--r-- | tests/bugs150/AnnotationBinding.aj | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/bugs150/AnnotationBinding.aj b/tests/bugs150/AnnotationBinding.aj new file mode 100644 index 000000000..dad91da68 --- /dev/null +++ b/tests/bugs150/AnnotationBinding.aj @@ -0,0 +1,37 @@ +import org.aspectj.lang.reflect.MethodSignature; +import org.aspectj.lang.annotation.SuppressAjWarnings; +import java.lang.annotation.*; +public aspect AnnotationBinding { + + pointcut callToABeanMethod(Bean beanAnnotation) : + call(@Bean * *(..)) && @annotation(beanAnnotation); + + @SuppressAjWarnings + Object around(Bean beanAnnotation) : callToABeanMethod(beanAnnotation) { + return proceed(beanAnnotation); + } + + public static void main(String[] args) { + D d = new D(); + d.bar(); + } + +} + +@Retention(RetentionPolicy.RUNTIME) +@interface Bean { + + boolean issingleton() default true; +} + +class C { + + @Bean + public void foo() {} + +} + +class D extends C { + + public void bar() { foo(); } +}
\ No newline at end of file |