1
0
şunun yansıması https://github.com/eclipse-aspectj/aspectj.git eşitlendi 2024-07-24 22:04:44 +02:00
org.aspectj/tests/new/AfterConstructorCalls.java

25 satır
512 B
Java
Ham Normal Görünüm Geçmiş

2002-12-16 19:51:06 +01:00
import org.aspectj.testing.Tester;
public class AfterConstructorCalls {
public static void main(String[] args) {
new Foo().bar();
}
}
class Foo {
int bar() { return 0; }
}
aspect A {
pointcut nimboCut() :
call(Foo.new(..));
/*static*/ after() returning (Object o): nimboCut() {
Tester.check(o != null && o instanceof Foo, o + " !instanceof Foo");
}
/*static*/ after() returning (int i): call(int Foo.*(..)) {
Tester.checkEqual(i, 0);
}
}