From 354653d5afebb6dfdb631cadeb2f4474d5371107 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 12 Dec 2005 14:30:51 +0000 Subject: [PATCH] updates for 116679 (targetting old runtimes) --- weaver/src/org/aspectj/weaver/World.java | 6 +++++- .../org/aspectj/weaver/bcel/TjpWeaveTestCase.java | 10 ++++++++++ .../org/aspectj/weaver/bcel/WeaveTestCase.java | 14 ++++++++++---- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/World.java b/weaver/src/org/aspectj/weaver/World.java index 85dec384d..e67caa136 100644 --- a/weaver/src/org/aspectj/weaver/World.java +++ b/weaver/src/org/aspectj/weaver/World.java @@ -661,7 +661,11 @@ public abstract class World implements Dump.INode { } public boolean isTargettingAspectJRuntime12() { - return getTargetAspectjRuntimeLevel().equals(org.aspectj.weaver.Constants.RUNTIME_LEVEL_12); + boolean b = false; // pr116679 + if (!isInJava5Mode()) b=true; + else b = getTargetAspectjRuntimeLevel().equals(org.aspectj.weaver.Constants.RUNTIME_LEVEL_12); + //System.err.println("Asked if targetting runtime 1.2 , returning: "+b); + return b; } /* diff --git a/weaver/testsrc/org/aspectj/weaver/bcel/TjpWeaveTestCase.java b/weaver/testsrc/org/aspectj/weaver/bcel/TjpWeaveTestCase.java index 6dc75c4e7..bcb543c77 100644 --- a/weaver/testsrc/org/aspectj/weaver/bcel/TjpWeaveTestCase.java +++ b/weaver/testsrc/org/aspectj/weaver/bcel/TjpWeaveTestCase.java @@ -30,6 +30,16 @@ public class TjpWeaveTestCase extends WeaveTestCase { public TjpWeaveTestCase(String name) { super(name); } + + public void setUp() { + super.setUp(); + behave15=true; + } + + public void tearDown() throws Exception { + super.tearDown(); + behave15=false; + } public void testStaticTjp() throws IOException { diff --git a/weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java b/weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java index c3a84b977..7126acca9 100644 --- a/weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java +++ b/weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java @@ -28,6 +28,7 @@ public abstract class WeaveTestCase extends TestCase { public boolean regenerate = false; public boolean runTests = true; + public boolean behave15 = false; File outDir; String outDirPath; @@ -75,12 +76,17 @@ public abstract class WeaveTestCase extends TestCase { public void weaveTest(String name, String outName, List planners) throws IOException { BcelWeaver weaver = new BcelWeaver(world); + try { + if (behave15) world.setBehaveInJava5Way(true); - UnwovenClassFile classFile = makeUnwovenClassFile(classDir, name, outDirPath); + UnwovenClassFile classFile = makeUnwovenClassFile(classDir, name, outDirPath); - weaver.addClassFile(classFile); - weaver.setShadowMungers(planners); - weaveTestInner(weaver, classFile, name, outName); + weaver.addClassFile(classFile); + weaver.setShadowMungers(planners); + weaveTestInner(weaver, classFile, name, outName); + } finally { + if (behave15) world.setBehaveInJava5Way(false); + } } -- 2.39.5