From 4018fb57e0131b7cf8b70ac1bceb7610a7cb3e55 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 11 Jun 2008 20:54:25 +0000 Subject: [PATCH] 223226: test and fix for NPE and duplicate signature --- weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java index 2bd4db5ca..a4f49a7d6 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java @@ -714,10 +714,12 @@ class BcelClassWeaver implements IClassWeaver { UnresolvedType[] bm = BcelWorld.fromBcel(bridgeToCandidate.getArgumentTypes()); ResolvedMember overriddenMethod = checkForOverride(theSuperclass,name,psig,rsig,bridgeToCandidate.getAccessFlags(),pkgName,bm); if (overriddenMethod!=null) { - boolean alreadyHaveABridgeMethod = methodsSet.contains(overriddenMethod.getName()+overriddenMethod.getSignature()); + String key = new StringBuffer().append(overriddenMethod.getName()).append(overriddenMethod.getSignature()).toString(); + boolean alreadyHaveABridgeMethod = methodsSet.contains(key); if (!alreadyHaveABridgeMethod) { if (world.forDEBUG_bridgingCode) System.err.println("Bridging:bridging to '"+overriddenMethod+"'"); createBridgeMethod(world, bridgeToCandidate, clazz, overriddenMethod); + methodsSet.add(key); didSomething = true; continue; // look at the next method } @@ -730,9 +732,11 @@ class BcelClassWeaver implements IClassWeaver { ResolvedType interfaceType = world.resolve(interfaces[j]); overriddenMethod = checkForOverride(interfaceType,name,psig,rsig,bridgeToCandidate.getAccessFlags(),clazz.getPackageName(),bm); if (overriddenMethod!=null) { - boolean alreadyHaveABridgeMethod = methodsSet.contains(overriddenMethod.getName()+overriddenMethod.getSignature()); + String key = new StringBuffer().append(overriddenMethod.getName()).append(overriddenMethod.getSignature()).toString(); + boolean alreadyHaveABridgeMethod = methodsSet.contains(key); if (!alreadyHaveABridgeMethod) { createBridgeMethod(world, bridgeToCandidate, clazz, overriddenMethod); + methodsSet.add(key); didSomething=true; if (world.forDEBUG_bridgingCode) System.err.println("Bridging:bridging to "+overriddenMethod); continue; // look at the next method -- 2.39.5