diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2023-08-05 12:15:37 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2023-08-06 09:38:11 +0700 |
commit | f44dc75e6b0e9a80b41dce7b43fa1a393a4a2adb (patch) | |
tree | 44f59d4f40a1b05001b05e02343832128ef8f390 /weaver | |
parent | 8170ae6ffd7068a3f224de0df2008d74d6b9d35b (diff) | |
download | aspectj-f44dc75e6b0e9a80b41dce7b43fa1a393a4a2adb.tar.gz aspectj-f44dc75e6b0e9a80b41dce7b43fa1a393a4a2adb.zip |
Fix inline accessor method bug in BcelAccessForInlineMunger
Make sure to create one ajc$inlineAccessMethod per identically named
(overloaded) private aspect method in
BcelAccessForInlineMunger.createOrGetInlineAccessorForMethod.
Fixes #250.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/main/java/org/aspectj/weaver/bcel/BcelAccessForInlineMunger.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelAccessForInlineMunger.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelAccessForInlineMunger.java index 6bc5cb4a0..3736353b2 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelAccessForInlineMunger.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelAccessForInlineMunger.java @@ -101,7 +101,11 @@ public class BcelAccessForInlineMunger extends BcelTypeMunger { */ @Override public ResolvedMember getMatchingSyntheticMember(Member member) { - ResolvedMember rm = inlineAccessors.get(member.getName());// + member.getSignature()); + String name = member.getName(); + String signature = name.startsWith("ajc$superDispatch$") + ? member.getSignature() + : member.getSignature().replaceFirst("\\([^;]+;", "("); + ResolvedMember rm = inlineAccessors.get(name + signature); // System.err.println("lookup for " + member.getName() + ":" + member.getSignature() + " = " // + (rm == null ? "" : rm.getName())); return rm; @@ -229,7 +233,7 @@ public class BcelAccessForInlineMunger extends BcelTypeMunger { private ResolvedMember createOrGetInlineAccessorForMethod(ResolvedMember resolvedMember) { String accessorName = NameMangler.inlineAccessMethodForMethod(resolvedMember.getName(), resolvedMember.getDeclaringType(), aspectType); - String key = accessorName;// new StringBuilder(accessorName).append(resolvedMember.getSignature()).toString(); + String key = accessorName + resolvedMember.getSignature(); ResolvedMember inlineAccessor = inlineAccessors.get(key); // System.err.println(key + " accessor=" + inlineAccessor); if (inlineAccessor == null) { @@ -272,7 +276,7 @@ public class BcelAccessForInlineMunger extends BcelTypeMunger { private ResolvedMember createOrGetInlineAccessorForSuperDispatch(ResolvedMember resolvedMember) { String accessor = NameMangler.superDispatchMethod(aspectType, resolvedMember.getName()); - String key = accessor; + String key = accessor + resolvedMember.getSignature(); ResolvedMember inlineAccessor = inlineAccessors.get(key); if (inlineAccessor == null) { @@ -316,7 +320,7 @@ public class BcelAccessForInlineMunger extends BcelTypeMunger { private ResolvedMember createOrGetInlineAccessorForFieldGet(ResolvedMember resolvedMember) { String accessor = NameMangler.inlineAccessMethodForFieldGet(resolvedMember.getName(), resolvedMember.getDeclaringType(), aspectType); - String key = accessor; + String key = accessor + "()" + resolvedMember.getSignature(); ResolvedMember inlineAccessor = inlineAccessors.get(key); if (inlineAccessor == null) { @@ -357,7 +361,7 @@ public class BcelAccessForInlineMunger extends BcelTypeMunger { private ResolvedMember createOrGetInlineAccessorForFieldSet(ResolvedMember resolvedMember) { String accessor = NameMangler.inlineAccessMethodForFieldSet(resolvedMember.getName(), resolvedMember.getDeclaringType(), aspectType); - String key = accessor; + String key = accessor + "(" + resolvedMember.getSignature() + ")V"; ResolvedMember inlineAccessor = inlineAccessors.get(key); if (inlineAccessor == null) { |