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

Driver.java 548B

1234567891011121314151617181920212223242526272829
  1. import org.aspectj.testing.Tester;
  2. // PR#151
  3. public class Driver {
  4. public static void main(String[] args) { test(); }
  5. public static void test() {
  6. Tester.checkEqual(C.set(), "C-advised-set", "");
  7. }
  8. static advice(C c): c && * *(..) {
  9. before {
  10. if (c != null)
  11. Tester.check(false, "c == null");
  12. else
  13. c.s += "-advised";
  14. }
  15. }
  16. }
  17. class C {
  18. static String s = "C";
  19. static String set() {
  20. s += "-set";
  21. return s;
  22. }
  23. }