From 962f6e7732d88d5590f5167f36f78b66984c136b Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 11 Jul 2005 10:51:05 +0000 Subject: [PATCH] generics: improved type resolution, aware of raw/simple/parameterized/generic --- .../org/aspectj/weaver/bcel/BcelWorld.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java b/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java index 71e8eb7cf..7133d824b 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java @@ -268,14 +268,28 @@ public class BcelWorld extends World implements Repository { public BcelObjectType addSourceObjectType(JavaClass jc) { + BcelObjectType ret = null; String signature = TypeX.forName(jc.getClassName()).getSignature(); ReferenceType nameTypeX = (ReferenceType)typeMap.get(signature); - if (nameTypeX == null) { - nameTypeX = new ReferenceType(signature, this); + if (nameTypeX == null) { + if (jc.isGeneric()) { + nameTypeX = ReferenceType.fromTypeX(TypeX.forRawTypeNames(jc.getClassName()),this); + ret = makeBcelObjectType(nameTypeX, jc, true); + ReferenceType genericRefType = new ReferenceType( + TypeX.forGenericTypeSignature(signature,ret.getDeclaredGenericSignature()),this); + nameTypeX.setDelegate(ret); + genericRefType.setDelegate(ret); + nameTypeX.setGenericType(genericRefType); + typeMap.put(signature, nameTypeX); + } else { + nameTypeX = new ReferenceType(signature, this); + ret = makeBcelObjectType(nameTypeX, jc, true); + typeMap.put(signature, nameTypeX); + } + } else { + ret = makeBcelObjectType(nameTypeX, jc, true); } - BcelObjectType ret = makeBcelObjectType(nameTypeX, jc, true); - typeMap.put(signature, nameTypeX); return ret; } -- 2.39.5