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());
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);
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(
}
public static class WeaverOption {
- boolean java5;
+ boolean java5;
boolean lazyTjp;
boolean hasMember;
String optionalJoinpoints;
IMessageHandler messageHandler;
String lint;
String lintFile;
+ String xSet;
public WeaverOption(IMessageHandler imh) {
// messageHandler = new DefaultMessageHandler();//default
--- /dev/null
+<aspectj>
+ <weaver options="-Xset:pipelineCompilation=false -verbose -showWeaveInfo -Xlintfile:Xlint-empty.properties"/>
+ <aspect name="Aspect1"/>
+</aspectj>
+
--- /dev/null
+<aspectj>
+ <weaver options="-Xset:runMinimalMemory=true,pipelineCompilation=true,captureAllContext=false,activateLightweightDelegates=true,debugStructuralChangesCode=false,debugBridging=false -Xlintfile:Xlint-empty.properties"/>
+</aspectj>
+
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");
}
</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">