Browse Source

fixed bug with LTW Xreweavable, fix this reflective issue in RunAllBeforeCommit (was misnamed..)

tags/PRE_ANDY
avasseur 19 years ago
parent
commit
191c26bb4f

+ 1
- 1
run-all-junit-tests/testsrc/AllTests.java View 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"));
}

+ 2
- 2
testing-util/src/org/aspectj/testing/util/TestUtil.java View 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

+ 1
- 0
tests/java5/ataspectj/ajc-ant.xml View 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>


+ 1
- 1
tests/java5/ataspectj/ataspectj/PerClauseTest.java View File

@@ -203,7 +203,7 @@ public class PerClauseTest extends TestCase {
;//ok
}
}
static class PTW1 {
static void foo() {};
}

+ 8
- 7
tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java View 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");

+ 1
- 0
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java View 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

+ 5
- 19
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java View 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

Loading…
Cancel
Save