aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs150/pr98901/Case02.aj
blob: 2ad28a606afdf05ad5573fce3ac5d4da57be2711 (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
//"public method on the aspect that declares @method on it"

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

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

aspect B02 {
	public void a(){}
	declare @method : void B02.a(..) : @anInterface;
	
	public static void main(String [] args){
		Class c = B02.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!");
		}
	}
}