summaryrefslogtreecommitdiffstats
path: root/tests/bugs151/pr98901/Failing2.java
blob: 1daeb4498d7618ab7b30b1c68a452d9247dd87db (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
import java.lang.annotation.*;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@interface TestAnnotation {
  public boolean value() default true;
}

aspect TestAspect {
  declare parents: Failing2 implements TestInterface;
  
  declare @method: public void TestInterface.foo(): @TestAnnotation;

  public void TestInterface.foo() {
    System.err.println("foo");
  }
}

interface TestInterface {
  public void foo();
}

public class Failing2 {
  public static void main(String[] args) throws Exception {
	System.err.println("On TestInterface:"+TestInterface.class.getDeclaredMethod("foo").getAnnotation(TestAnnotation.class)); 
    System.err.println("On Failing2:"+Failing2.class.getDeclaredMethod("foo").getAnnotation(TestAnnotation.class)); 
  }
}