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.

Testcase1.java 520B

123456789101112131415161718192021222324252627
  1. public class Testcase1 {
  2. public static void main(String [] args) {
  3. new Testcase1().sayhi();
  4. }
  5. public void sayhi() {
  6. System.out.println("Hello World");
  7. }
  8. }
  9. // Note the use of an if inside a perthis, causes the ajc compiler to
  10. // throw an exception
  11. aspect Aspect perthis(if(4==3)) {
  12. before () : call(* println(..)) && !within(Aspect*) {
  13. System.out.println("Advice 1");
  14. }
  15. }
  16. aspect Aspect2 pertarget(if(3==4)) {}
  17. aspect Aspect3 percflow(if(3==4)) {}
  18. aspect Aspect4 percflowbelow(if(3==4)) {}