From 039be6888f9ec674a0bbb0f5fc37486f8565fece Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 8 Aug 2006 13:50:57 +0000 Subject: [PATCH] patches from 152161 --- .../loadtime/ClassLoaderWeavingAdaptor.java | 1 + .../org/aspectj/weaver/loadtime/Options.java | 9 ++++++-- tests/ltw/aop-xset-verbose.xml | 5 +++++ tests/ltw/aop-xset.xml | 4 ++++ .../systemtest/ajc150/ltw/LTWTests.java | 7 ++++++ .../systemtest/ajc150/ltw/ltw-tests.xml | 22 +++++++++++++++++++ 6 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 tests/ltw/aop-xset-verbose.xml create mode 100644 tests/ltw/aop-xset.xml diff --git a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java index 75775e5ea..47b9368c6 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java @@ -251,6 +251,7 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor { world.setOptionalJoinpoints(weaverOption.optionalJoinpoints); world.setPinpointMode(weaverOption.pinpoint); weaver.setReweavableMode(weaverOption.notReWeavable); + world.performExtraConfiguration(weaverOption.xSet); world.setXnoInline(weaverOption.noInline); // AMC - autodetect as per line below, needed for AtAjLTWTests.testLTWUnweavable world.setBehaveInJava5Way(LangUtil.is15VMOrGreater()); diff --git a/loadtime/src/org/aspectj/weaver/loadtime/Options.java b/loadtime/src/org/aspectj/weaver/loadtime/Options.java index 0c1a99b54..67265343f 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/Options.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/Options.java @@ -45,7 +45,7 @@ public class Options { private static final String OPTIONVALUED_Xlintfile = "-Xlintfile:"; private static final String OPTIONVALUED_Xlint = "-Xlint:"; private static final String OPTIONVALUED_joinpoints = "-Xjoinpoints:"; - + private static final String OPTIONVALUED_Xset = "-Xset:"; public static WeaverOption parse(String options, ClassLoader laoder, IMessageHandler imh) { WeaverOption weaverOption = new WeaverOption(imh); @@ -118,6 +118,10 @@ public class Options { if (arg.length() > OPTIONVALUED_Xlint.length()) { weaverOption.lint = arg.substring(OPTIONVALUED_Xlint.length()).trim(); } + } else if (arg.startsWith(OPTIONVALUED_Xset)) { + if (arg.length() > OPTIONVALUED_Xlint.length()) { + weaverOption.xSet = arg.substring(OPTIONVALUED_Xset.length()).trim(); + } } else { weaverOption.messageHandler.handleMessage( new Message( @@ -145,7 +149,7 @@ public class Options { } public static class WeaverOption { - boolean java5; + boolean java5; boolean lazyTjp; boolean hasMember; String optionalJoinpoints; @@ -160,6 +164,7 @@ public class Options { IMessageHandler messageHandler; String lint; String lintFile; + String xSet; public WeaverOption(IMessageHandler imh) { // messageHandler = new DefaultMessageHandler();//default diff --git a/tests/ltw/aop-xset-verbose.xml b/tests/ltw/aop-xset-verbose.xml new file mode 100644 index 000000000..e83ad709d --- /dev/null +++ b/tests/ltw/aop-xset-verbose.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/tests/ltw/aop-xset.xml b/tests/ltw/aop-xset.xml new file mode 100644 index 000000000..dcad617ab --- /dev/null +++ b/tests/ltw/aop-xset.xml @@ -0,0 +1,4 @@ + + + + diff --git a/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java b/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java index 73b6eebd1..5097fa861 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java @@ -65,6 +65,13 @@ public class LTWTests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("Ensure weaver lint warning issued when an aspect is not used for weaving"); } + public void testXsetEnabled () { + runTest("Set Xset properties enabled"); + } + public void testXsetDisabled () { + runTest("Set Xset properties disabled"); + } + public void testXlintfileEmpty () { runTest("Empty Xlint.properties file"); } diff --git a/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml b/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml index bc7120870..976d36e64 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml @@ -234,6 +234,28 @@ + + + + + + + + + + + + + + -- 2.39.5