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.

AspectRedefinesParam.java 538B

12345678910111213141516171819202122232425262728
  1. import org.aspectj.testing.Tester;
  2. /**
  3. * Test for: PR #65
  4. */
  5. public aspect AspectRedefinesParam {
  6. public static void main(String[] args) { test(); }
  7. public static void test() {
  8. Tester.checkEqual(new Foo().b("a"), "a", "b('a')");
  9. }
  10. pointcut ccut(String s): this(Foo) && call(String b(String)) && args(s);
  11. before(String methodString): ccut(methodString) {
  12. String s;
  13. s = "b";
  14. methodString += s;
  15. }
  16. }
  17. class Foo {
  18. String b( String s ) {
  19. return s;
  20. }
  21. }