aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs195/550494/DataSourceConnectionAspectAnno.java
blob: d78b4819298c6d8d21f1f34bdf70e588b6c9bf09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package foo;

import javax.sql.DataSource;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.DeclareParents;

@Aspect
public class DataSourceConnectionAspectAnno {
  // This statement crashes the AspectJ compiler
  @DeclareParents("foo.BaseClass")
  private DataSource dataSource;
  
  @Before("execution(public java.sql.Connection javax.sql.DataSource+.getConnection(..))")
  public void myAdvice(JoinPoint thisJoinPoint) {
    System.out.println(thisJoinPoint);
  }
}