From c0a48634088f7f894ab998dfcc5b7ccf7df88b42 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Sun, 25 Jun 2023 12:17:48 +0200 Subject: [PATCH] Correctly identify ITD method signatures in weaver by removing faulty condition 'if (isCtorRelated)' from BcelTypeMunger.getRealMemberForITDFromAspect, see comment https://github.com/eclipse-aspectj/aspectj/issues/246#issuecomment-1605999896. Fixes #246. Signed-off-by: Alexander Kriegisch --- .../main/java/org/aspectj/weaver/bcel/BcelTypeMunger.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelTypeMunger.java index 3463d444a..64e9ce42f 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelTypeMunger.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelTypeMunger.java @@ -1606,12 +1606,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger { System.err.println("Reviewing potential candidates: " + member); } boolean matchOK = true; - // If not related to a ctor ITD then the name is enough to - // confirm we have the - // right one. If it is ctor related we need to check the - // params all match, although - // only the erasure. - if (isCtorRelated) { + // Check that all method/ctor params all match, although only the erasure for (int j = 0; j < memberParams.length && matchOK; j++) { ResolvedType pMember = memberParams[j].resolve(world); ResolvedType pLookingFor = lookingForParams[j].resolve(world); @@ -1639,7 +1634,6 @@ public class BcelTypeMunger extends ConcreteTypeMunger { matchOK = false; } } - } if (matchOK) { realMember = member; } -- 2.39.5