aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs150/pr98901/Case21.aj
blob: 2da5b44332066a4925ecbcbacb87b2cd2c96010c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// "public abstract ITD method onto an Interface with declare @method"

import java.lang.annotation.*;
import java.lang.reflect.Method;

@Retention(RetentionPolicy.RUNTIME)
@interface anInterface{}

interface A21 {
}

aspect B21 {
	
	public abstract void A21.a();
	declare @method : abstract void A21.a(..) : @anInterface;
	
	public static void main(String [] args){
		Class c = A21.class;
		try {
			Method m = c.getDeclaredMethod("a", new Class [0]);
			Annotation [] anns = m.getDeclaredAnnotations();
			for (int i = 0;i < anns.length;i++){
				System.out.println(anns[i]);
			}
		} catch (Exception e){
			System.out.println("exceptional!");
		}
	}
}