aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs1810/500035/Code2.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs1810/500035/Code2.java')
-rw-r--r--tests/bugs1810/500035/Code2.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/bugs1810/500035/Code2.java b/tests/bugs1810/500035/Code2.java
new file mode 100644
index 000000000..23eddce7e
--- /dev/null
+++ b/tests/bugs1810/500035/Code2.java
@@ -0,0 +1,30 @@
+import org.aspectj.lang.annotation.*;
+import org.aspectj.lang.*;
+
+@Aspect
+public class Code2 {
+
+ @Around(value = "args(regex, replacement) && target(targetObject) " +
+ "&& call(public String String.replaceFirst(String, String)) && this(c)"
+//, argNames = "proceedingJoinPoint,targetObject,regex,replacement,thisJoinPoint"
+)
+ public String replaceFirstAspect(ProceedingJoinPoint proceedingJoinPoint, Code2 c, String targetObject, String regex, String replacement) throws Throwable {
+System.out.println("targetObject = "+targetObject);
+System.out.println("regex = "+regex);
+System.out.println("replacement = "+replacement);
+ String returnObject = (String) proceedingJoinPoint.proceed(new Object[]{ c, targetObject, regex, replacement});
+ return returnObject;
+ }
+
+
+ public static void main(String []argv) {
+ new Code2().run();
+ }
+
+ public void run() {
+ String s = "hello";
+ s = s.replaceFirst("l","8");
+ System.out.println(s);
+ }
+
+}