From 7d99a23266ff26d1be0bd46af8ab7b3951cb9230 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 23 May 2006 10:37:22 +0000 Subject: test and fix for first part of 126355 --- .../src/org/aspectj/weaver/bcel/BcelObjectType.java | 19 +++++++++++++------ weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java | 1 - 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'weaver') diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java index d48eaa8f8..d352731cd 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java @@ -480,12 +480,19 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate { superClass = newParent; } else { ResolvedType[] oldInterfaceNames = getDeclaredInterfaces(); - int len = oldInterfaceNames.length; - ResolvedType[] newInterfaceNames = new ResolvedType[len+1]; - System.arraycopy(oldInterfaceNames, 0, newInterfaceNames, 0, len); - newInterfaceNames[len] = newParent; - - interfaces = newInterfaceNames; + int exists = -1; + for (int i = 0; i < oldInterfaceNames.length; i++) { + ResolvedType type = oldInterfaceNames[i]; + if (type.equals(newParent)) {exists = i;break; } + } + if (exists==-1) { + int len = oldInterfaceNames.length; + ResolvedType[] newInterfaceNames = new ResolvedType[len+1]; + System.arraycopy(oldInterfaceNames, 0, newInterfaceNames, 0, len); + newInterfaceNames[len] = newParent; + + interfaces = newInterfaceNames; + } } //System.err.println("javaClass: " + Arrays.asList(javaClass.getInterfaceNames()) + " super " + superclassName); //if (lazyClassGen != null) lazyClassGen.print(); diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java index 6533ea131..f03a1c835 100644 --- a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java +++ b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java @@ -581,7 +581,6 @@ public final class LazyClassGen { signature.append("<"); for (int i = 0; i < tVars.length; i++) { TypeVariable variable = tVars[i]; - if (i!=0) signature.append(","); signature.append(variable.getSignature()); } signature.append(">"); -- cgit v1.2.3