]> source.dussan.org Git - aspectj.git/commitdiff
updates for 116679 (targetting old runtimes)
authoraclement <aclement>
Mon, 12 Dec 2005 14:30:51 +0000 (14:30 +0000)
committeraclement <aclement>
Mon, 12 Dec 2005 14:30:51 +0000 (14:30 +0000)
weaver/src/org/aspectj/weaver/World.java
weaver/testsrc/org/aspectj/weaver/bcel/TjpWeaveTestCase.java
weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java

index 85dec384d06c2a0223158d0ccc9ffe629d0a1fb1..e67caa1365f50e8d8236565085ed3d602b4199b7 100644 (file)
@@ -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;
        }
        
        /*
index 6dc75c4e7c293c974ff213d485cbf9c5f40b1313..bcb543c771a3ae2f38f115671241c2eaf6e8487a 100644 (file)
@@ -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 {
index c3a84b977b73725377098f4a0c6c12ea6e86750c..7126acca9277bfed0865965074ed0fc2ecb59612 100644 (file)
@@ -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);
+        }
        }