summaryrefslogtreecommitdiffstats
path: root/tests/bugs152/pr135865
diff options
context:
space:
mode:
authoraclement <aclement>2006-05-17 12:15:23 +0000
committeraclement <aclement>2006-05-17 12:15:23 +0000
commit2c5fd746cb28ed8ad3990229ea2f861bbb815821 (patch)
tree73549d76468f5fc1135ebb915f035206c90b5f87 /tests/bugs152/pr135865
parent5f6a6b12c560f80dd720a943c4c63cf8dc182cc3 (diff)
downloadaspectj-2c5fd746cb28ed8ad3990229ea2f861bbb815821.tar.gz
aspectj-2c5fd746cb28ed8ad3990229ea2f861bbb815821.zip
proper testcode for 135865
Diffstat (limited to 'tests/bugs152/pr135865')
-rw-r--r--tests/bugs152/pr135865/A.java14
-rw-r--r--tests/bugs152/pr135865/Aoriginal.java31
-rw-r--r--tests/bugs152/pr135865/B.java3
3 files changed, 34 insertions, 14 deletions
diff --git a/tests/bugs152/pr135865/A.java b/tests/bugs152/pr135865/A.java
index 940540c26..2f75db8a9 100644
--- a/tests/bugs152/pr135865/A.java
+++ b/tests/bugs152/pr135865/A.java
@@ -5,17 +5,7 @@ import java.lang.annotation.*;
aspect Aspect {
- // Call to an annotated method
- pointcut annotated(Ann b) : call(@Ann * *(..)) && @annotation(b);
-
- // Top level call to an annotated method
- pointcut annotatedTop(Ann b) : annotated(b) && !cflowbelow(annotated(Ann));
-
- // Non top level call
- pointcut annotatedNotTop(Ann b, Ann bTopo) :
- annotated(b) && cflowbelow(annotatedTop(bTopo));
-
- before(Ann b, Ann bTopo) : annotatedNotTop(b, bTopo) {
+ before() : call(@Ann * *(..)) {
System.out.println("\tJoin point: " + thisJoinPointStaticPart);
}
@@ -24,7 +14,7 @@ aspect Aspect {
}
public class A {
- @Ann void foo() { new B().foo(); new B().goo();}
+ void foo() { new B().foo(); }
public static void main(String[] args) { new A().foo(); }
}
diff --git a/tests/bugs152/pr135865/Aoriginal.java b/tests/bugs152/pr135865/Aoriginal.java
new file mode 100644
index 000000000..0d79d584f
--- /dev/null
+++ b/tests/bugs152/pr135865/Aoriginal.java
@@ -0,0 +1,31 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME) @interface Ann {}
+
+
+aspect Aspect {
+
+ // Call to an annotated method
+ pointcut annotated(Ann b) : call(@Ann * *(..)) && @annotation(b);
+
+ // Top level call to an annotated method
+ pointcut annotatedTop(Ann b) : annotated(b) && !cflowbelow(annotated(Ann));
+
+ // Non top level call
+ pointcut annotatedNotTop(Ann b, Ann bTopo) :
+ annotated(b) && cflowbelow(annotatedTop(bTopo));
+
+ //before(Ann b, Ann bTopo) : annotatedNotTop(b, bTopo) {
+ before() : call(@Ann * *(..)) { //(b, bTopo) {
+ System.out.println("\tJoin point: " + thisJoinPointStaticPart);
+ }
+
+ // Methods with out the Ann annotation but in an Ann annotated type get Ann
+ declare @method: !@Ann * (@Ann *).*(..) : @Ann;
+}
+
+public class A {
+ void foo() { new B().foo(); /*new B().goo();*/}
+ public static void main(String[] args) { new A().foo(); }
+}
+
diff --git a/tests/bugs152/pr135865/B.java b/tests/bugs152/pr135865/B.java
index c12542dd6..756b7db00 100644
--- a/tests/bugs152/pr135865/B.java
+++ b/tests/bugs152/pr135865/B.java
@@ -2,5 +2,4 @@
@Ann class B {
//@Ann
void foo() { }
- void goo() { }
-} \ No newline at end of file
+}