From 21850ffb157cae71d570c17483bbceb197a7ceae Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 18 Jun 2008 17:18:51 +0000 Subject: [PATCH] 237447: test and fix: nested parameterization --- .../src/org/aspectj/weaver/TypeFactory.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/weaver/src/org/aspectj/weaver/TypeFactory.java b/weaver/src/org/aspectj/weaver/TypeFactory.java index b314d4001..aeea50c90 100644 --- a/weaver/src/org/aspectj/weaver/TypeFactory.java +++ b/weaver/src/org/aspectj/weaver/TypeFactory.java @@ -14,6 +14,8 @@ package org.aspectj.weaver; import java.util.ArrayList; import java.util.List; +import org.aspectj.asm.internal.CharOperation; + /** * @author colyer * @@ -245,4 +247,27 @@ public class TypeFactory { types.toArray(typeParams); return typeParams; } + + // OPTIMIZE improve all this signature processing stuff, use char arrays, etc + + /** + * Create a signature then delegate to the other factory method. Same input/output: + * baseTypeSignature="LSomeType;" + * arguments[0]= something with sig "Pcom/Foo;" + * signature created = "PSomeType;>;" + */ + public static UnresolvedType createUnresolvedParameterizedType(String baseTypeSignature, UnresolvedType[] arguments) { + StringBuffer parameterizedSig = new StringBuffer(); + parameterizedSig.append(ResolvedType.PARAMETERIZED_TYPE_IDENTIFIER); + parameterizedSig.append(baseTypeSignature.substring(1,baseTypeSignature.length()-1)); + if (arguments.length > 0) { + parameterizedSig.append("<"); + for (int i=0;i"); + } + parameterizedSig.append(";"); + return createUnresolvedParameterizedType(parameterizedSig.toString(),baseTypeSignature,arguments); + } } -- 2.39.5