From: acolyer Date: Fri, 4 Nov 2005 09:03:45 +0000 (+0000) Subject: autodetect java version and configure world accordingly (now that aj is stricter... X-Git-Tag: V1_5_0RC1~259 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a3e8bb5c97809d468330a566d7e548a68b222ad3;p=aspectj.git autodetect java version and configure world accordingly (now that aj is stricter about not allowing java 5 features at < 1.5 level, this was needed for some LTW tests to pass too) --- diff --git a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java index b160e4960..b3bbcbc1b 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java @@ -17,6 +17,7 @@ import org.aspectj.bridge.IMessage; import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.Message; import org.aspectj.bridge.MessageUtil; +import org.aspectj.util.LangUtil; import org.aspectj.weaver.ICrossReferenceHandler; import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.UnresolvedType; @@ -202,7 +203,9 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor { world.setPinpointMode(weaverOption.pinpoint); weaver.setReweavableMode(weaverOption.notReWeavable); world.setXnoInline(weaverOption.noInline); - world.setBehaveInJava5Way(weaverOption.java5);//TODO should be autodetected ? + //world.setBehaveInJava5Way(weaverOption.java5);//TODO should be autodetected ? + // AMC - autodetect as per line below, needed for AtAjLTWTests.testLTWUnweavable + world.setBehaveInJava5Way(LangUtil.is15VMOrGreater()); //-Xlintfile: first so that lint wins if (weaverOption.lintFile != null) { InputStream resource = null;