aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2016-11-18 09:00:28 -0800
committerAndy Clement <aclement@pivotal.io>2016-11-18 09:00:28 -0800
commitb6f2b6337fbaf95b78c20862cd90f0e027509531 (patch)
treeda38bdf8ab392b0e6f49da7a676a75f885fe9b85 /weaver
parente8be95bbfd291f93319d1a1e9920e44cd7eb7569 (diff)
downloadaspectj-b6f2b6337fbaf95b78c20862cd90f0e027509531.tar.gz
aspectj-b6f2b6337fbaf95b78c20862cd90f0e027509531.zip
Fix 500035: handling target only binding in @AJ pointcut
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelShadow.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java
index 94462d5ff..10fdbd05c 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java
@@ -2586,11 +2586,11 @@ public class BcelShadow extends Shadow {
ret.append(InstructionFactory.createArrayLoad(Type.OBJECT));
ret.append(Utility.createConversion(fact, Type.OBJECT, callbackMethod.getArgumentTypes()[0]));
} else {
- int position = (hasThis()/* && pointcutBindsThis */? 1 : 0);
+ int position = (hasThis() && pointcutBindsThis)? 1 : 0;
ret.append(InstructionFactory.createLoad(objectArrayType, theObjectArrayLocalNumber));
ret.append(Utility.createConstant(fact, position));
ret.append(InstructionFactory.createArrayLoad(Type.OBJECT));
- ret.append(Utility.createConversion(fact, Type.OBJECT, callbackMethod.getArgumentTypes()[position]));
+ ret.append(Utility.createConversion(fact, Type.OBJECT, callbackMethod.getArgumentTypes()[nextArgumentToProvideForCallback]));
}
nextArgumentToProvideForCallback++;
} else {
@@ -3049,12 +3049,9 @@ public class BcelShadow extends Shadow {
/**
*
- *
* @param callbackMethod the method we will call back to when our run method gets called.
- *
* @param proceedMap A map from state position to proceed argument position. May be non covering on state position.
*/
-
private LazyMethodGen makeClosureClassAndReturnConstructor(String closureClassName, LazyMethodGen callbackMethod,
IntMap proceedMap) {
String superClassName = "org.aspectj.runtime.internal.AroundClosure";
@@ -3076,7 +3073,7 @@ public class BcelShadow extends Shadow {
closureClass.addMethodGen(constructor);
- // method
+ // Create the 'Object run(Object[])' method
LazyMethodGen runMethod = new LazyMethodGen(Modifier.PUBLIC, Type.OBJECT, "run", new Type[] { objectArrayType },
new String[] {}, closureClass);
InstructionList mbody = runMethod.getBody();
@@ -3092,12 +3089,11 @@ public class BcelShadow extends Shadow {
Type[] stateTypes = callbackMethod.getArgumentTypes();
for (int i = 0, len = stateTypes.length; i < len; i++) {
- Type stateType = stateTypes[i];
- ResolvedType stateTypeX = BcelWorld.fromBcel(stateType).resolve(world);
+ ResolvedType resolvedStateType = BcelWorld.fromBcel(stateTypes[i]).resolve(world);
if (proceedMap.hasKey(i)) {
- mbody.append(proceedVar.createConvertableArrayLoad(fact, proceedMap.get(i), stateTypeX));
+ mbody.append(proceedVar.createConvertableArrayLoad(fact, proceedMap.get(i), resolvedStateType));
} else {
- mbody.append(stateVar.createConvertableArrayLoad(fact, i, stateTypeX));
+ mbody.append(stateVar.createConvertableArrayLoad(fact, i, resolvedStateType));
}
}