]> source.dussan.org Git - aspectj.git/commitdiff
patches from 152161
authoraclement <aclement>
Tue, 8 Aug 2006 13:50:57 +0000 (13:50 +0000)
committeraclement <aclement>
Tue, 8 Aug 2006 13:50:57 +0000 (13:50 +0000)
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
loadtime/src/org/aspectj/weaver/loadtime/Options.java
tests/ltw/aop-xset-verbose.xml [new file with mode: 0644]
tests/ltw/aop-xset.xml [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java
tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml

index 75775e5ea612ec5a235c6a912a0fda5f0e3cb17c..47b9368c60547659b13c24e86d8bf16bc825b635 100644 (file)
@@ -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());
index 0c1a99b5488a7c0f563151804f120b047e2af05a..67265343fe8baa21a2d1bda4cc2347e807fd587d 100644 (file)
@@ -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 (file)
index 0000000..e83ad70
--- /dev/null
@@ -0,0 +1,5 @@
+<aspectj>
+       <weaver options="-Xset:pipelineCompilation=false -verbose -showWeaveInfo -Xlintfile:Xlint-empty.properties"/>
+       <aspect name="Aspect1"/>
+</aspectj>
+
diff --git a/tests/ltw/aop-xset.xml b/tests/ltw/aop-xset.xml
new file mode 100644 (file)
index 0000000..dcad617
--- /dev/null
@@ -0,0 +1,4 @@
+<aspectj>
+       <weaver options="-Xset:runMinimalMemory=true,pipelineCompilation=true,captureAllContext=false,activateLightweightDelegates=true,debugStructuralChangesCode=false,debugBridging=false -Xlintfile:Xlint-empty.properties"/>
+</aspectj>
+
index 73b6eebd14b7ec306fb3e4ab7cf4edb7e5c16435..5097fa8618fdb4efc4591f3ac7dd3cbfbed53c5a 100644 (file)
@@ -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");
        }
index bc71208702321e8835c2156834123e8a8b0425cc..976d36e64503b30c8b0c10632f492278b30f37c4 100644 (file)
         </run>
     </ajc-test>
     
+       <ajc-test dir="ltw"
+      title="Set Xset properties enabled"
+      keywords="xSet, ltw">
+        <compile
+               files="Main.java,Aspect1.aj"
+        >
+        </compile>     
+        <run class="Main" ltw="aop-xset-verbose.xml" xlintfile="Xlint-empty.properties">
+        </run>
+    </ajc-test>
+
+       <ajc-test dir="ltw"
+      title="Set Xset properties disabled"
+      keywords="xSet, ltw">
+        <compile
+               files="Main.java,Aspect1.aj"
+        >
+        </compile>     
+        <run class="Main" ltw="aop-xset-verbose.xml" xlintfile="Xlint-empty.properties">
+        </run>
+    </ajc-test>
+    
        <ajc-test dir="ltw"
       title="Warning with missing Xlint.properties file"
       keywords="xlint, ltw">