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.

ExternalCalls.java 492B

12345678910111213141516171819202122
  1. import org.aspectj.testing.Tester;
  2. public class ExternalCalls {
  3. public static void main(String[] args){
  4. Tester.checkEqual(new Test().go(), 1003);
  5. Tester.checkEqual(Math.max(1, 3), 3);
  6. }
  7. }
  8. class Test {
  9. int go(){
  10. return Math.max(1, 3);
  11. }
  12. }
  13. aspect A percflow(this(Test) && execution(* go(..))) {
  14. // ! call(* Test.go()) shouldn't do anything
  15. int around(): call(int Math.*(..)) && ! call(* Test.go()) {
  16. return proceed() + 1000;
  17. }
  18. }