diff options
author | acolyer <acolyer> | 2005-09-02 17:12:43 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-09-02 17:12:43 +0000 |
commit | df46c6f728502a74b2d042a0a955eab1326ba76a (patch) | |
tree | 5d0e149d509e85b685f532aee75c984afd2e09f1 /weaver | |
parent | 2c88c598b950136bf54376eecbf58f14a19666c4 (diff) | |
download | aspectj-df46c6f728502a74b2d042a0a955eab1326ba76a.tar.gz aspectj-df46c6f728502a74b2d042a0a955eab1326ba76a.zip |
tests and fix for pr99125 - duplicate members in interfaces after binary weaving
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java | 6 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java | 14 |
2 files changed, 17 insertions, 3 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java index e677685ed..8100a4d92 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java @@ -733,6 +733,12 @@ public class BcelTypeMunger extends ConcreteTypeMunger { return false; } + if (onInterface && gen.getLazyMethodGen(unMangledInterMethod.getName(), unMangledInterMethod.getSignature(),true) != null) { + // this is ok, we could be providing the default implementation of a method + // that the target has already declared + return false; + } + if (onType.equals(gen.getType())) { ResolvedMember mangledInterMethod = AjcMemberMaker.interMethod(unMangledInterMethod, aspectType, onInterface); diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java index 887b1a16b..f75ec647f 100644 --- a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java +++ b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java @@ -1126,18 +1126,26 @@ public final class LazyClassGen { } public LazyMethodGen getLazyMethodGen(Member m) { - return getLazyMethodGen(m.getName(), m.getSignature()); + return getLazyMethodGen(m.getName(), m.getSignature(),false); } public LazyMethodGen getLazyMethodGen(String name, String signature) { + return getLazyMethodGen(name,signature,false); + } + + public LazyMethodGen getLazyMethodGen(String name, String signature,boolean allowMissing) { for (Iterator i = methodGens.iterator(); i.hasNext();) { LazyMethodGen gen = (LazyMethodGen) i.next(); if (gen.getName().equals(name) && gen.getSignature().equals(signature)) return gen; } - throw new BCException("Class " + this.getName() + " does not have a method " - + name + " with signature " + signature); + if (!allowMissing) { + throw new BCException("Class " + this.getName() + " does not have a method " + + name + " with signature " + signature); + } + + return null; } public void forcePublic() { |