aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs1612/pr345172/InterType2.java
blob: d442f5ee29ab45053055ca289cbe5f24656c2dd1 (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
33
34
35
36
37
38
39
40
41
42
43
44
import static java.lang.annotation.ElementType.*;
import java.lang.annotation.*;

public aspect InterType2 {

  @Retention(RetentionPolicy.RUNTIME)
  @Target({METHOD})
  public @interface MyAnnotation {
  }

  public static aspect AroundMethod {
    Object around() : execution(@MyAnnotation * * (..)) {
      System.out.println(thisJoinPointStaticPart);
      return proceed();
    }   
  }

  public interface InterTypeIfc {}

  // (1)
  @MyAnnotation
  public void InterTypeIfc.m1(int p1) {}

  // (2)
  public void InterTypeIfc.m1(int p1, int p2) {}

  // (3)
//  @MyAnnotation
//  public void m1(int p1) {}

  // (4)
//  public void m1(int p1, int p2) {}


  public static void main(String []argv) throws Exception {
    new Foo().m1(1);
    new Foo().m1(1,2);
  }

  declare parents: Foo implements InterTypeIfc;
 
  static class Foo {
  }
}