peilaus alkaen
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-09-03 05:54:57 +02:00
23 rivejä
514 B
Java
23 rivejä
514 B
Java
import org.aspectj.testing.*;
|
|
|
|
public class Orleans {
|
|
static boolean called = false;
|
|
public static void main(String[] args) {
|
|
String hello[] = new String[] { "h", "e", "l", "l", "o" };
|
|
Object o = new Object();
|
|
o = new Orleans(true);
|
|
Tester.check(called, "Advice was not called.");
|
|
}
|
|
|
|
public Orleans(boolean b) {}
|
|
}
|
|
|
|
aspect ResourceAccounting issingleton() {
|
|
pointcut constructions(): call(new(..));
|
|
before(): constructions() {
|
|
Orleans.called = true;
|
|
}
|
|
}
|
|
|
|
|