From: Andy Clement Date: Wed, 11 Sep 2019 16:04:15 +0000 (-0700) Subject: 543657: tweak to use current data rather than last known packed data X-Git-Tag: V1_9_5~14 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=feacb252cb69a1ae7b0faeb0951847346f73c61d;p=aspectj.git 543657: tweak to use current data rather than last known packed data --- diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java index b8ede0a9a..cca34bc12 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java @@ -11,6 +11,8 @@ *******************************************************************************/ package org.aspectj.weaver.bcel; +import java.util.List; + import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.generic.InstructionBranch; import org.aspectj.apache.bcel.generic.InstructionConstants; @@ -31,7 +33,7 @@ import org.aspectj.weaver.patterns.PerClause; /** * Adds aspectOf(), hasAspect() etc to the annotation defined aspects - * + * * @author Alexandre Vasseur * @author Andy Clement */ @@ -140,9 +142,8 @@ public class BcelPerClauseAspectAdder extends BcelTypeMunger { } private boolean hasPerClauseMembersAlready(LazyClassGen classGen) { - ResolvedMember[] methods = classGen.getBcelObjectType().getDeclaredMethods(); - for (int i = 0; i < methods.length; i++) { - ResolvedMember method = methods[i]; + List methodGens = classGen.getMethodGens(); + for (LazyMethodGen method: methodGens) { if ("aspectOf".equals(method.getName())) { if ("()".equals(method.getParameterSignature()) && (kind == PerClause.SINGLETON || kind == PerClause.PERCFLOW)) { return true; @@ -542,7 +543,7 @@ public class BcelPerClauseAspectAdder extends BcelTypeMunger { /** * Add standard Synthetic (if wished) and AjSynthetic (always) attributes - * + * * @param methodGen * @param makeJavaSynthetic true if standard Synthetic attribute must be set as well (invisible to user) */