aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs/pr72531/de/rohith/HelloWorldAspect.java
diff options
context:
space:
mode:
authoracolyer <acolyer>2004-08-24 21:10:56 +0000
committeracolyer <acolyer>2004-08-24 21:10:56 +0000
commit82eae551311afbd3a942d54e55b1c569c5f975b8 (patch)
tree8a716f4fe9e62354f60594b34185cd6fe53de541 /tests/bugs/pr72531/de/rohith/HelloWorldAspect.java
parentcfaa79ae72fba6619700f259fd4b05eaed6d3988 (diff)
downloadaspectj-82eae551311afbd3a942d54e55b1c569c5f975b8.tar.gz
aspectj-82eae551311afbd3a942d54e55b1c569c5f975b8.zip
fix for Bugzilla Bug 72531
declare warning warns at wrong points
Diffstat (limited to 'tests/bugs/pr72531/de/rohith/HelloWorldAspect.java')
-rw-r--r--tests/bugs/pr72531/de/rohith/HelloWorldAspect.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/bugs/pr72531/de/rohith/HelloWorldAspect.java b/tests/bugs/pr72531/de/rohith/HelloWorldAspect.java
new file mode 100644
index 000000000..cbe1dc707
--- /dev/null
+++ b/tests/bugs/pr72531/de/rohith/HelloWorldAspect.java
@@ -0,0 +1,31 @@
+package de.rohith;
+import java.lang.Object;
+
+public aspect HelloWorldAspect {
+
+ private int callDepth = -1;
+
+ public HelloWorldAspect() {
+ }
+
+ pointcut hello(): !within(HelloWorldAspect);
+
+ pointcut method(): execution(public (*[]) de..*(..));
+
+ pointcut cloning(): call(* java.lang.Object.clone());
+
+ declare warning: method() && hello(): "*[] returning method called" ;
+
+ Object[] around(): cflow(method()) && cloning() && hello() {
+ print("", thisEnclosingJoinPointStaticPart);
+ Object[] ret = proceed();
+ return (Object[])ret.clone();
+ }
+
+ private void print(String prefix, Object message) {
+ for (int i = 0, spaces = callDepth * 2; i < spaces; i++) {
+ System.out.print(" ");
+ }
+ System.out.println(prefix + message);
+ }
+}