aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/CallsToArray.java
diff options
context:
space:
mode:
authorwisberg <wisberg>2002-12-16 18:51:06 +0000
committerwisberg <wisberg>2002-12-16 18:51:06 +0000
commit144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch)
treeb12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/new/CallsToArray.java
parentfafae443719b26159ab2d7dac1c9b46b5e00b671 (diff)
downloadaspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz
aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip
initial version
Diffstat (limited to 'tests/new/CallsToArray.java')
-rw-r--r--tests/new/CallsToArray.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/new/CallsToArray.java b/tests/new/CallsToArray.java
new file mode 100644
index 000000000..dfa8ba019
--- /dev/null
+++ b/tests/new/CallsToArray.java
@@ -0,0 +1,29 @@
+import org.aspectj.testing.Tester;
+
+public class CallsToArray {
+ public static void main(String[] args) {
+ byte[] a = new byte[] {0, 1};
+ byte[] b = (byte[])a.clone();
+
+ Tester.check(a != b, "cloned array is different");
+ Tester.check(a[0] == b[0] && a[1] == b[1], "but compares equal");
+
+ Tester.check(A.returnedClone == b, "advice did right thing");
+ }
+
+}
+
+
+aspect A {
+ static Object returnedClone;
+ after () returning(Object cloned): call(Object Object.clone()) {
+ System.out.println("running advice");
+ A.returnedClone = cloned;
+ }
+ /*
+ static after () returning(Object cloned): calls(Object .clone()) {
+ System.out.println("running advice on byte[]");
+ A.returnedClone = cloned;
+ }
+ */
+}