aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoraclement <aclement>2008-06-11 20:54:25 +0000
committeraclement <aclement>2008-06-11 20:54:25 +0000
commit4018fb57e0131b7cf8b70ac1bceb7610a7cb3e55 (patch)
tree382b1730d4b16596e8b1fe319328bed4c0731a37 /weaver
parentb794e2a851cfe3219159ae078a6c76f05753827f (diff)
downloadaspectj-4018fb57e0131b7cf8b70ac1bceb7610a7cb3e55.tar.gz
aspectj-4018fb57e0131b7cf8b70ac1bceb7610a7cb3e55.zip
223226: test and fix for NPE and duplicate signature
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java8
1 files 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