aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs/cflowAndJar
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-07-22 22:51:34 +0000
committerjhugunin <jhugunin>2003-07-22 22:51:34 +0000
commit9894a3d4826ef3480a53aa7cd8d86804af3f1fdd (patch)
tree74e1f791f1edad64aaa894da598f653b0a1743f2 /tests/bugs/cflowAndJar
parent026b2728aef846823419ebffceb57fe8161e3d15 (diff)
downloadaspectj-9894a3d4826ef3480a53aa7cd8d86804af3f1fdd.tar.gz
aspectj-9894a3d4826ef3480a53aa7cd8d86804af3f1fdd.zip
fix and expanded tests for Bugzilla Bug 39462
Compiler crashes in jar and cflow
Diffstat (limited to 'tests/bugs/cflowAndJar')
-rw-r--r--tests/bugs/cflowAndJar/AbstractAspect.aj9
-rw-r--r--tests/bugs/cflowAndJar/Test.java11
-rw-r--r--tests/bugs/cflowAndJar/TestAspect.aj11
-rw-r--r--tests/bugs/cflowAndJar/lib.jarbin662 -> 662 bytes
4 files changed, 27 insertions, 4 deletions
diff --git a/tests/bugs/cflowAndJar/AbstractAspect.aj b/tests/bugs/cflowAndJar/AbstractAspect.aj
index 529cc08b6..24e786213 100644
--- a/tests/bugs/cflowAndJar/AbstractAspect.aj
+++ b/tests/bugs/cflowAndJar/AbstractAspect.aj
@@ -1,6 +1,13 @@
public abstract aspect AbstractAspect{
public abstract pointcut directCall();
+
before(): directCall(){
- System.out.println("direct");
+ noteDirectCall();
}
+
+ abstract void noteDirectCall();
+
+ public abstract pointcut badCall();
+
+ declare warning: badCall(): "bad";
}
diff --git a/tests/bugs/cflowAndJar/Test.java b/tests/bugs/cflowAndJar/Test.java
index 079ac6b22..9349ca4b0 100644
--- a/tests/bugs/cflowAndJar/Test.java
+++ b/tests/bugs/cflowAndJar/Test.java
@@ -1,8 +1,15 @@
-public class Test{
+import org.aspectj.testing.Tester;
+
+public class Test {
public static void main(String[] arguments){
Test test = new Test();
- test.sayHello();
+ Tester.checkEqual(TestAspect.sawDirectCall, false, "no calls");
+
test.doSayHello();
+ Tester.checkEqual(TestAspect.sawDirectCall, false, "non-cflow");
+
+ test.sayHello();
+ Tester.checkEqual(TestAspect.sawDirectCall, true, "in-cflow");
}
public void sayHello(){
diff --git a/tests/bugs/cflowAndJar/TestAspect.aj b/tests/bugs/cflowAndJar/TestAspect.aj
index a6ed50ae6..78c93e86a 100644
--- a/tests/bugs/cflowAndJar/TestAspect.aj
+++ b/tests/bugs/cflowAndJar/TestAspect.aj
@@ -1,6 +1,15 @@
public aspect TestAspect extends AbstractAspect{
public pointcut directCall():
execution(void Test.doSayHello(..))
- && cflow(execution(void Test.direct(..)))
+ && cflow(execution(void Test.sayHello(..)))
;
+
+ public pointcut badCall():
+ call(void Test.doSayHello(..)) && withincode(void Test.sayHello(..));
+
+ void noteDirectCall() {
+ sawDirectCall = true;
+ }
+
+ public static boolean sawDirectCall = false;
}
diff --git a/tests/bugs/cflowAndJar/lib.jar b/tests/bugs/cflowAndJar/lib.jar
index e80bb93b8..46368f2d2 100644
--- a/tests/bugs/cflowAndJar/lib.jar
+++ b/tests/bugs/cflowAndJar/lib.jar
Binary files differ