diff options
author | aclement <aclement> | 2006-08-02 08:45:44 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-08-02 08:45:44 +0000 |
commit | d15e56b4599a3a5d19e42aee5ae72c2b05c243a3 (patch) | |
tree | f35338c7fb436383a3fa4d9107387b666097df00 | |
parent | bebb3640698bf2c465b64d9565123ec699dac45d (diff) | |
download | aspectj-d15e56b4599a3a5d19e42aee5ae72c2b05c243a3.tar.gz aspectj-d15e56b4599a3a5d19e42aee5ae72c2b05c243a3.zip |
failure when lock()/unlock() used in XML defined pointcut and would require synchronization transform of a method
3 files changed, 55 insertions, 0 deletions
diff --git a/tests/features152/synchronization/transformed/CaptureLock.aj b/tests/features152/synchronization/transformed/CaptureLock.aj new file mode 100644 index 000000000..3e1f2706a --- /dev/null +++ b/tests/features152/synchronization/transformed/CaptureLock.aj @@ -0,0 +1,8 @@ +public abstract aspect CaptureLock { + + abstract pointcut lockPC(); + + before(): lockPC() { + System.out.println("Before a lock or unlock"); + } +} diff --git a/tests/features152/synchronization/transformed/Program.java b/tests/features152/synchronization/transformed/Program.java new file mode 100644 index 000000000..2d92cfa81 --- /dev/null +++ b/tests/features152/synchronization/transformed/Program.java @@ -0,0 +1,35 @@ +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; + +public class Program { + public static void main(String[] args) { + new Program().b(); + new Program().c(); + new Program().d(); + } + + // ... that does something ... + public synchronized void b() { + System.out.println("hello from b()"); + } + + // ... that includes try/catch ... + public synchronized void c() { + try { + File f = new File("fred"); + FileInputStream fis = new FileInputStream(f); + } catch (IOException ioe) { + System.out.println("bang in c()"); + } + } + + // ... with nested synchronized blocks ... + public synchronized void d() { + System.out.println("hello from d()"); + synchronized (new String()) { + System.out.println("hello from block in d()"); + } + } + +} diff --git a/tests/features152/synchronization/transformed/aop1.xml b/tests/features152/synchronization/transformed/aop1.xml new file mode 100644 index 000000000..660f20b47 --- /dev/null +++ b/tests/features152/synchronization/transformed/aop1.xml @@ -0,0 +1,12 @@ +<aspectj> + <aspects> + <concrete-aspect name="G8" + extends="CaptureLock"> + + <pointcut name="lockPC" expression="(within(*) AND (lock() || unlock()))" /> + + </concrete-aspect> + </aspects> + + <weaver options="-verbose -showWeaveInfo -Xjoinpoints:synchronization"/> +</aspectj> |