You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Driver.java 436B

123456789101112131415161718192021
  1. import org.aspectj.testing.Tester;
  2. // PR#162
  3. // works with JDK > 1.2 but not with JDK < 1.1.8
  4. public aspect Driver {
  5. public static void main(String[] args) { test(); }
  6. public static void test() {
  7. Tester.checkEqual(new C().fi, 1, "");
  8. }
  9. pointcut install(): execution(new()) && within(C);
  10. /*static*/ after () : install() { }
  11. }
  12. class C {
  13. public final int fi;
  14. C() {
  15. fi = 1;
  16. }
  17. }