From feacb252cb69a1ae7b0faeb0951847346f73c61d Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Wed, 11 Sep 2019 09:04:15 -0700 Subject: [PATCH] 543657: tweak to use current data rather than last known packed data --- .../aspectj/weaver/bcel/BcelPerClauseAspectAdder.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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) */ -- 2.39.5