From ce470b7a64ce9f1daedd8f1843d08ab53a501d63 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 22 May 2008 23:57:24 +0000 Subject: [PATCH] 227401: test and fix - use correct declaring type when building tjp so getDeclaringType() works at runtime --- weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java index 1dbb48f54..6fa80c5e2 100644 --- a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java +++ b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java @@ -69,6 +69,7 @@ import org.aspectj.weaver.WeaverMessages; import org.aspectj.weaver.WeaverStateInfo; import org.aspectj.weaver.World; import org.aspectj.weaver.AjAttribute.WeaverVersionInfo; +import org.aspectj.weaver.UnresolvedType.TypeKind; /** @@ -1113,7 +1114,13 @@ public final class LazyClassGen { BcelWorld w = shadow.getWorld(); list.append(new PUSH(getConstantPoolGen(),makeString(sig.getModifiers(w)))); list.append(new PUSH(getConstantPoolGen(),sig.getName())); - list.append(new PUSH(getConstantPoolGen(),makeString(sig.getDeclaringType()))); + // see pr227401 + UnresolvedType dType = sig.getDeclaringType(); + if (dType.getTypekind()==TypeKind.PARAMETERIZED || + dType.getTypekind()==TypeKind.GENERIC) { + dType = sig.getDeclaringType().resolve(world).getGenericType(); + } + list.append(new PUSH(getConstantPoolGen(),makeString(dType))); list.append(new PUSH(getConstantPoolGen(),makeString(sig.getReturnType()))); list.append(fact.createInvoke(factoryType.getClassName(), sig.getSignatureMakerName(), -- 2.39.5