From c17d9d32781bdeadd1b30e166c5c88cb0b258fab Mon Sep 17 00:00:00 2001 From: aclement Date: Sat, 4 Apr 2009 18:42:04 +0000 Subject: [PATCH] 271169: test and fix: npe in weave call method with 4 longs --- weaver/src/org/aspectj/weaver/bcel/BcelShadow.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java index 086b8f166..3220aecd4 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java @@ -2334,24 +2334,24 @@ public class BcelShadow extends Shadow { end = end.getPrev(); } Type[] args = localAdviceMethod.getArgumentTypes(); - int i = 0; - for (int slot = 0; slot < extraParamOffset; i++) { + int argNumber = 0; + for (int slot = 0; slot < extraParamOffset; argNumber++) { // slot will increase by the argument size each time String argumentName = null; - if (i >= args.length || parameterNames.size() == 0 || i >= parameterNames.size()) { + if (argNumber >= args.length || parameterNames.size() == 0 || argNumber >= parameterNames.size()) { // this should be unnecessary as I think all known joinpoints and helper methods // propagate the parameter names around correctly - but just in case let us do this // rather than fail. If a bug is raised reporting unknown as a local variable name // then investigate the joinpoint giving rise to the ResolvedMember and why it has // no parameter names specified - argumentName = new StringBuffer("unknown").append(i).toString(); + argumentName = new StringBuffer("unknown").append(argNumber).toString(); } else { - argumentName = (String) parameterNames.get(i); + argumentName = (String) parameterNames.get(argNumber); } - String argumentSignature = args[i].getSignature(); + String argumentSignature = args[argNumber].getSignature(); LocalVariableTag lvt = new LocalVariableTag(argumentSignature, argumentName, slot, 0); start.addTargeter(lvt); end.addTargeter(lvt); - slot += args[slot].getSize(); + slot += args[argNumber].getSize(); } } -- 2.39.5