From 572e8e4d8bf9cae92510e822c291e9bb791da683 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 2 Aug 2006 08:46:25 +0000 Subject: [PATCH] Fix for failure when lock()/unlock() used in XML defined pointcut and would require synchronization transform of a method --- .../ajc152/SynchronizationTransformTests.java | 4 ++++ .../systemtest/ajc152/synchronization.xml | 21 +++++++++++++++++++ .../aspectj/weaver/bcel/AtAjAttributes.java | 1 + 3 files changed, 26 insertions(+) diff --git a/tests/src/org/aspectj/systemtest/ajc152/SynchronizationTransformTests.java b/tests/src/org/aspectj/systemtest/ajc152/SynchronizationTransformTests.java index 75f57c8fe..ec4c1280a 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/SynchronizationTransformTests.java +++ b/tests/src/org/aspectj/systemtest/ajc152/SynchronizationTransformTests.java @@ -174,6 +174,10 @@ public class SynchronizationTransformTests extends XMLBasedAjcTestCase { public void testJoinpointsEnabledButNoLock() { runTest("joinpoints enabled but no lock"); } + + public void testTransformWithLTW() { + runTest("transform with LTW"); + } // more complex code sequences... public void testOtherTargeters() { diff --git a/tests/src/org/aspectj/systemtest/ajc152/synchronization.xml b/tests/src/org/aspectj/systemtest/ajc152/synchronization.xml index d0cf6e0b2..8b4a7ed47 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/synchronization.xml +++ b/tests/src/org/aspectj/systemtest/ajc152/synchronization.xml @@ -164,6 +164,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java index 4e28a619e..4621fb776 100644 --- a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java +++ b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java @@ -1726,6 +1726,7 @@ public class AtAjAttributes { PatternParser parser = new PatternParser(pointcutString, struct.context); Pointcut pointcut = parser.parsePointcut(); parser.checkEof(); + pointcut.check(null,struct.enclosingType.getWorld()); if (!allowIf && pointcutString.indexOf("if()") >= 0 && hasIf(pointcut)) { reportError("if() pointcut is not allowed at this pointcut location '" + pointcutString +"'", struct); return null; -- 2.39.5