aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs152/pr147701/TestBean.java
blob: e22f092e4bccb9a8d3cbb63599b547dbfa123f07 (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
// simple version - we go bang if Impl doesnt implement I...

package a.b.c;

import org.aspectj.lang.annotation.*;

interface I { public void m(); }

class Impl implements I {
  public Impl() {}
  public void m() {}
}

@Aspect
class TestBeanAdvice {
  @DeclareParents(value="a.b.c.TestBean", defaultImpl=a.b.c.Impl.class)
  private I implementationInterface;
}

public class TestBean {
  public static void main(String []argv) throws Exception {
    ((I)new TestBean()).m();
  }
}

class BeansException extends Exception {}