aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-08-28 21:44:55 +0000
committerjhugunin <jhugunin>2003-08-28 21:44:55 +0000
commit5a07dcee3a3f520e4b5cadc67000673e2d0ca0b7 (patch)
tree771065369cab0955da5791a8648ede9c52216da7 /tests/bugs
parentd8b86743663c19fd545d8dea89290dccda7a5ed1 (diff)
downloadaspectj-5a07dcee3a3f520e4b5cadc67000673e2d0ca0b7.tar.gz
aspectj-5a07dcee3a3f520e4b5cadc67000673e2d0ca0b7.zip
fix and test for Bugzilla Bug 41359
percflow aspects compiled from jars share one instance for all entry points
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/perCflowAndJar/PerCFlowCompileFromJar.java20
-rw-r--r--tests/bugs/perCflowAndJar/PerCFlowCompileFromJarTest.java23
-rw-r--r--tests/bugs/perCflowAndJar/lib.jarbin0 -> 900 bytes
3 files changed, 43 insertions, 0 deletions
diff --git a/tests/bugs/perCflowAndJar/PerCFlowCompileFromJar.java b/tests/bugs/perCflowAndJar/PerCFlowCompileFromJar.java
new file mode 100644
index 000000000..cfb7c73e0
--- /dev/null
+++ b/tests/bugs/perCflowAndJar/PerCFlowCompileFromJar.java
@@ -0,0 +1,20 @@
+public abstract aspect PerCFlowCompileFromJar percflow( topOfFlow() ){
+
+ private boolean thisAspectInstanceIsDead = false;
+
+ protected abstract pointcut entryPoint();
+ protected pointcut topOfFlow(): entryPoint() && !cflowbelow( entryPoint() );
+
+ after() : topOfFlow() {
+ this.killThisAspectInstance();
+ }
+
+ protected void killThisAspectInstance(){
+ if (thisAspectInstanceIsDead)
+ throw new IllegalStateException("This aspect instance has been used and can't be used again.");
+ else
+ thisAspectInstanceIsDead = true;
+ }
+}
+
+
diff --git a/tests/bugs/perCflowAndJar/PerCFlowCompileFromJarTest.java b/tests/bugs/perCflowAndJar/PerCFlowCompileFromJarTest.java
new file mode 100644
index 000000000..cf30fcc78
--- /dev/null
+++ b/tests/bugs/perCflowAndJar/PerCFlowCompileFromJarTest.java
@@ -0,0 +1,23 @@
+
+public class PerCFlowCompileFromJarTest {
+
+ public static void main(String[] args) throws Exception {
+ PerCFlowTestHelper c1 = new PerCFlowTestHelper();
+ PerCFlowTestHelper c2 = new PerCFlowTestHelper();
+ PerCFlowTestHelper c3 = new PerCFlowTestHelper();
+ c1.startNewPerCFlow();
+ c2.startNewPerCFlow();
+ c3.startNewPerCFlow();
+ }
+}
+
+class PerCFlowTestHelper {
+ public void startNewPerCFlow()throws Exception{
+ //do nothing
+ }
+}
+
+aspect MyTestPerCFlowEntryPoint extends PerCFlowCompileFromJar {
+ protected pointcut entryPoint():
+ execution( public void PerCFlowTestHelper.startNewPerCFlow() );
+} \ No newline at end of file
diff --git a/tests/bugs/perCflowAndJar/lib.jar b/tests/bugs/perCflowAndJar/lib.jar
new file mode 100644
index 000000000..6ca2c5007
--- /dev/null
+++ b/tests/bugs/perCflowAndJar/lib.jar
Binary files differ