]> source.dussan.org Git - aspectj.git/commitdiff
fixed bug with LTW Xreweavable, fix this reflective issue in RunAllBeforeCommit ...
authoravasseur <avasseur>
Mon, 13 Jun 2005 09:21:14 +0000 (09:21 +0000)
committeravasseur <avasseur>
Mon, 13 Jun 2005 09:21:14 +0000 (09:21 +0000)
run-all-junit-tests/testsrc/AllTests.java
testing-util/src/org/aspectj/testing/util/TestUtil.java
tests/java5/ataspectj/ajc-ant.xml
tests/java5/ataspectj/ataspectj/PerClauseTest.java
tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java

index 116812b20e56567b84bc13398cb95bfc7c4acee3..57ccf35bf3f34c5cceb9960e3c6ca6e39aaf505a 100644 (file)
@@ -46,7 +46,7 @@ public class AllTests extends TestCase {
             // with 1.5, i.e., wrong class version to load under 1.3
             // so the class name can only be used reflectively
             TestUtil.loadTestsReflectively(suite, "Aspectj5rtModuleTests", false);
-            TestUtil.loadTestsReflectively(suite, "Loadtime5ModuleTests", false);
+            TestUtil.loadTestsReflectively(suite, "Loadtime515ModuleTests", false);
         } else {
             suite.addTest(TestUtil.skipTest("for 1.5"));
         } 
index ecd73847830f7ca36995adf2d1f46d6009c721c5..16d0a396a80bc9d58c344daf1450160db76dc504 100644 (file)
@@ -204,7 +204,7 @@ public final class TestUtil {
     }
     
     /**
-     * @param s the String to parse for [on|off|true|false]
+     * @param input the String to parse for [on|off|true|false]
      * @throws IllegalArgumentException if input is bad
      **/
     public static boolean parseBoolean(String input) {
@@ -212,7 +212,7 @@ public final class TestUtil {
     }
     
     /**
-     * @param s the String to parse for [on|off|true|false]
+     * @param input the String to parse for [on|off|true|false]
      * @param iaxOnError if true and input is bad, throw
      * IllegalArgumentException
      * @return true if input is true, false otherwise
index 85f1367da61a5bebaefc181afce3f6030d52ab1e..0703756e556feed2b56473cd2e296de83b9b2038 100644 (file)
@@ -30,6 +30,7 @@
             <classpath refid="aj.path"/>
             <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
             <jvmarg value="-Daj5.def=ataspectj/aop-perclausetest.xml"/>
+<!--            <jvmarg line="${jdwp}"/>            -->
         </java>
     </target>
 
index 2688736965efed7780975071fd5f25e72155f1d9..08e0194894f8bef30250bdd4d4a67462e6cd62ab 100644 (file)
@@ -203,7 +203,7 @@ public class PerClauseTest extends TestCase {
             ;//ok
         }
     }
-    
+
     static class PTW1 {
         static void foo() {};
     }
index 5bc6ea025b5f85cb7d72130db3f012d59ffcf0bd..145426d7023d7619ffef745b6622c01fea8f846e 100644 (file)
@@ -36,14 +36,15 @@ public class AtAjLTWTests extends XMLBasedAjcTestCase {
        public void testAjcLTWPerClauseTest_XnoWeave() {
                runTest("AjcLTW PerClauseTest -XnoWeave");
        }
+//FIXME AV - fails with ?? ataspectj\PerClauseTestAspects.java::0 the parameter jp is not bound in [all branches of] pointcut
 //
-//     public void testAjcLTWPerClauseTest_Xreweavable() {
-//             runTest("AjcLTW PerClauseTest -Xreweavable");
-//     }
-//
-//    public void testJavaCAjcLTWPerClauseTest() {
-//        runTest("JavaCAjcLTW PerClauseTest");
-//    }
+       public void testAjcLTWPerClauseTest_Xreweavable() {
+               runTest("AjcLTW PerClauseTest -Xreweavable");
+       }
+
+    public void testJavaCAjcLTWPerClauseTest() {
+        runTest("JavaCAjcLTW PerClauseTest");
+    }
 
     public void testAjcLTWAroundInlineMungerTest_XnoWeave() {
         runTest("AjcLTW AroundInlineMungerTest -XnoWeave");
index f3a8cf88f30b34716a86dc049a3a222869eaf2d9..98ad849bbaafb0a50e26f0a3e1d4b22d6ac6425b 100644 (file)
@@ -541,6 +541,7 @@ public class AtAjAttributes {
                 Pointcut pc = null;
                 if (preResolvedPointcut != null) {
                     pc = preResolvedPointcut.getPointcut();
+                    //pc.resolve(binding);
                 } else {
                     pc = parsePointcut(beforeAdvice.getValue().stringifyValue(), struct, false);
                     if (pc == null) return false;//parse error
index ade0a191fe658a6017dc6aebd188ece3b0252911..a96237b1960759a311682c61326d92f59ebafd82 100644 (file)
@@ -242,8 +242,7 @@ public class BcelWeaver implements IWeaver {
 
 //     // The ANT copy task should be used to copy resources across.
 //     private final static boolean CopyResourcesFromInpathDirectoriesToOutput=false;
-       private Set alreadyConfirmedReweavableState;
-       
+
        /**
         * Add any .class files in the directory to the outdir.  Anything other than .class files in
         * the directory (or its subdirectories) are considered resources and are also copied. 
@@ -486,6 +485,7 @@ public class BcelWeaver implements IWeaver {
                         int numArgs = advice.getSignature().getParameterTypes().length;
                         if (numFormals > 0) {
                             names = advice.getSignature().getParameterNames(world);
+                            System.out.println(advice.getSignature().toLongString());//AVB
                             validateBindings(newP,p,numArgs,names);
                         }
                     } else {
@@ -947,18 +947,6 @@ public class BcelWeaver implements IWeaver {
                        processReweavableStateIfPresent(className, classType);
                }
 
-        // register all aspect that have been extracted from reweavable state for LTW
-        // note: when doing AJC, the missing aspect is already catch in the previous state thru Type.MISSING
-        if (alreadyConfirmedReweavableState != null) {
-            for (Iterator iterator = alreadyConfirmedReweavableState.iterator(); iterator.hasNext();) {
-                String aspectClassName = (String) iterator.next();
-                addLibraryAspect(aspectClassName);
-            }
-            // refresh all the stuff... perhaps too much here...
-            if (!alreadyConfirmedReweavableState.isEmpty())
-                prepareForWeave();
-        }
-
                requestor.addingTypeMungers();
         
         // We process type mungers in two groups, first mungers that change the type
@@ -1075,9 +1063,6 @@ public class BcelWeaver implements IWeaver {
                        world.showMessage(IMessage.INFO,
                                        WeaverMessages.format(WeaverMessages.REWEAVABLE_MODE),
                                        null, null);
-
-        //TODO AV - can't we avoid this creation (LTW = happens for each class load!)
-       alreadyConfirmedReweavableState = new HashSet();
     }
     
     public void processReweavableStateIfPresent(String className, BcelObjectType classType) {
@@ -1089,6 +1074,8 @@ public class BcelWeaver implements IWeaver {
                                        null,null);
                        Set aspectsPreviouslyInWorld = wsi.getAspectsAffectingType();
                        if (aspectsPreviouslyInWorld!=null) {
+                // keep track of them just to ensure unique missing aspect error reporting
+                Set alreadyConfirmedReweavableState = new HashSet();
                                for (Iterator iter = aspectsPreviouslyInWorld.iterator(); iter.hasNext();) {
                                        String requiredTypeName = (String) iter.next();
                                        if (!alreadyConfirmedReweavableState.contains(requiredTypeName)) {
@@ -1171,8 +1158,7 @@ public class BcelWeaver implements IWeaver {
                onType.clearInterTypeMungers();
                
                List decpToRepeat = new ArrayList();
-               List decaToRepeat = new ArrayList();
-               
+
                boolean aParentChangeOccurred      = false;
                boolean anAnnotationChangeOccurred = false;
                // First pass - apply all decp mungers