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.

Orleans.java 514B

12345678910111213141516171819202122
  1. import org.aspectj.testing.*;
  2. public class Orleans {
  3. static boolean called = false;
  4. public static void main(String[] args) {
  5. String hello[] = new String[] { "h", "e", "l", "l", "o" };
  6. Object o = new Object();
  7. o = new Orleans(true);
  8. Tester.check(called, "Advice was not called.");
  9. }
  10. public Orleans(boolean b) {}
  11. }
  12. aspect ResourceAccounting issingleton() {
  13. pointcut constructions(): call(new(..));
  14. before(): constructions() {
  15. Orleans.called = true;
  16. }
  17. }