From c366ca2a94a1c1d2296f3be9e9d92f737a2cb5a7 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 2 Mar 2007 08:23:41 +0000 Subject: [PATCH] integrated head into extensions branch --- weaver/src/org/aspectj/weaver/MemberImpl.java | 2 +- weaver/src/org/aspectj/weaver/ResolvedType.java | 4 +++- weaver/src/org/aspectj/weaver/bcel/BcelShadow.java | 12 +++++++++++- .../src/org/aspectj/weaver/bcel/BcelTypeMunger.java | 3 +-- weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java | 4 +++- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/MemberImpl.java b/weaver/src/org/aspectj/weaver/MemberImpl.java index 8b4635157..615f523dd 100644 --- a/weaver/src/org/aspectj/weaver/MemberImpl.java +++ b/weaver/src/org/aspectj/weaver/MemberImpl.java @@ -991,4 +991,4 @@ public class MemberImpl implements Comparable, AnnotatedElement,Member { } } - \ No newline at end of file + diff --git a/weaver/src/org/aspectj/weaver/ResolvedType.java b/weaver/src/org/aspectj/weaver/ResolvedType.java index 598b403f1..c60a24f7f 100644 --- a/weaver/src/org/aspectj/weaver/ResolvedType.java +++ b/weaver/src/org/aspectj/weaver/ResolvedType.java @@ -286,7 +286,9 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl boolean shouldSkip = false; for (int j = 0; j < rtx.interTypeMungers.size(); j++) { ConcreteTypeMunger munger = (ConcreteTypeMunger) rtx.interTypeMungers.get(j); - if (munger.getMunger()!=null && munger.getMunger().getKind() == ResolvedTypeMunger.Parent) { + if (munger.getMunger()!=null && munger.getMunger().getKind() == ResolvedTypeMunger.Parent + && ((NewParentTypeMunger)munger.getMunger()).getNewParent().equals(iface) // pr171953 + ) { shouldSkip = true; break; } diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java index a8e7b6332..9fb3d75da 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java @@ -2402,7 +2402,17 @@ public class BcelShadow extends Shadow { extraParamOffset += thisJoinPointVar.getType().getSize(); } - Type[] adviceParameterTypes = adviceMethod.getArgumentTypes(); + // We use the munger signature here because it allows for any parameterization of the mungers pointcut that + // may have occurred ie. if the pointcut is p(T t) in the super aspect and that has become p(Foo t) in the sub aspect + // then here the munger signature will have 'Foo' as an argument in it whilst the adviceMethod argument type will be 'Object' - since + // it represents the advice method in the superaspect which uses the erasure of the type variable p(Object t) - see pr174449. + + Type[] adviceParameterTypes = + BcelWorld.makeBcelTypes(munger.getSignature().getParameterTypes()); +// adviceMethod.getArgumentTypes(); + adviceMethod.getArgumentTypes(); // forces initialization ... dont like this but seems to be required for some tests to pass, I think that means + // there is a LazyMethodGen method that is not correctly setup to call initialize() when it is invoked - but I dont have + // time right now to discover which Type[] extractedMethodParameterTypes = extractedMethod.getArgumentTypes(); Type[] parameterTypes = new Type[extractedMethodParameterTypes.length diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java index 0a392cc26..016bf8a68 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java @@ -520,8 +520,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger { return true; //throw new BCException("no match for " + member + " in " + gen); } else if (member.getKind() == Member.STATIC_INITIALIZATION) { - gen.forcePublic(); - return true; + return gen.forcePublic(); } else { throw new RuntimeException("unimplemented"); } diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java index 6f6743f47..8f414f848 100644 --- a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java +++ b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java @@ -1321,8 +1321,10 @@ public final class LazyClassGen { } - public void forcePublic() { + public boolean forcePublic() { + if (myGen.isPublic()) return false; myGen.setAccessFlags(Utility.makePublic(myGen.getAccessFlags())); + return true; } -- 2.39.5