mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-09-13 15:45:38 +02:00
29 lines
538 B
Java
29 lines
538 B
Java
|
|
import org.aspectj.testing.Tester;
|
|
|
|
/**
|
|
* Test for: PR #65
|
|
*/
|
|
|
|
public aspect AspectRedefinesParam {
|
|
public static void main(String[] args) { test(); }
|
|
|
|
public static void test() {
|
|
Tester.checkEqual(new Foo().b("a"), "a", "b('a')");
|
|
}
|
|
|
|
pointcut ccut(String s): this(Foo) && call(String b(String)) && args(s);
|
|
|
|
before(String methodString): ccut(methodString) {
|
|
String s;
|
|
s = "b";
|
|
methodString += s;
|
|
}
|
|
}
|
|
|
|
class Foo {
|
|
String b( String s ) {
|
|
return s;
|
|
}
|
|
}
|