blob: f092ee6f3c7dbb0909014826239c6dbd196b7817 (
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
30
31
32
|
// "public abstract ITD-on-itself method with declare @method"
import java.lang.annotation.*;
import java.lang.reflect.Method;
@Retention(RetentionPolicy.RUNTIME)
@interface anInterface{}
abstract aspect A17 {
public abstract void A17.a();
declare @method : abstract void A17.a(..) : @anInterface;
}
aspect A17Sub extends A17 {
public void a() {}
}
aspect B17 {
public static void main(String [] args){
Class c = A17.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!");
}
}
}
|