選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

AfterConstructorCalls.java 512B

123456789101112131415161718192021222324
  1. import org.aspectj.testing.Tester;
  2. public class AfterConstructorCalls {
  3. public static void main(String[] args) {
  4. new Foo().bar();
  5. }
  6. }
  7. class Foo {
  8. int bar() { return 0; }
  9. }
  10. aspect A {
  11. pointcut nimboCut() :
  12. call(Foo.new(..));
  13. /*static*/ after() returning (Object o): nimboCut() {
  14. Tester.check(o != null && o instanceof Foo, o + " !instanceof Foo");
  15. }
  16. /*static*/ after() returning (int i): call(int Foo.*(..)) {
  17. Tester.checkEqual(i, 0);
  18. }
  19. }