From 952dda914064ff58a39fc682d18cdbf3ad171475 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 6 May 2005 15:18:54 +0000 Subject: Fix for 91053 (Generics): Generics problem with Set --- weaver/src/org/aspectj/weaver/TypeX.java | 26 +++++++++++++++++++++++--- weaver/src/org/aspectj/weaver/World.java | 2 +- 2 files changed, 24 insertions(+), 4 deletions(-) (limited to 'weaver/src') diff --git a/weaver/src/org/aspectj/weaver/TypeX.java b/weaver/src/org/aspectj/weaver/TypeX.java index f3f078c37..3f5c1f39e 100644 --- a/weaver/src/org/aspectj/weaver/TypeX.java +++ b/weaver/src/org/aspectj/weaver/TypeX.java @@ -28,6 +28,8 @@ public class TypeX implements AnnotatedElement { * If this is a parameterized type, these are its parameters */ protected TypeX[] typeParameters; + + protected boolean isParameterized = false; /** * @param signature the bytecode string representation of this Type @@ -114,6 +116,7 @@ public class TypeX implements AnnotatedElement { */ public static TypeX forParameterizedTypeNames(String name, String[] paramTypeNames) { TypeX ret = TypeX.forName(name); + ret.setParameterized(true); ret.typeParameters = new TypeX[paramTypeNames.length]; for (int i = 0; i < paramTypeNames.length; i++) { ret.typeParameters[i] = TypeX.forName(paramTypeNames[i]); @@ -130,6 +133,14 @@ public class TypeX implements AnnotatedElement { return ret; } + public static TypeX forRawTypeNames(String name) { + TypeX ret = TypeX.forName(name); + ret.setParameterized(true); + // FIXME asc no need to mess up the signature is there? + // ret.signature = ret.signature+"#RAW"; + return ret; + } + /** * Creates a new type array with a fresh type appended to the end. * @@ -237,7 +248,8 @@ public class TypeX implements AnnotatedElement { public String getBaseName() { String name = getName(); if (isParameterized()) { - return name.substring(0,name.indexOf("<")); + if (isRawType()) return name; + else return name.substring(0,name.indexOf("<")); } else { return name; } @@ -292,9 +304,17 @@ public class TypeX implements AnnotatedElement { * Determines if this represents a parameterized type. */ public final boolean isParameterized() { - return signature.indexOf("<") != -1; - //(typeParameters != null) && (typeParameters.length > 0); + return isParameterized; +// return signature.indexOf("<") != -1; +// //(typeParameters != null) && (typeParameters.length > 0); } + + public final boolean isRawType() { + return isParameterized && typeParameters==null; + } + + private final void setParameterized(boolean b) { isParameterized=b;} + /** * Returns a TypeX object representing the effective outermost enclosing type diff --git a/weaver/src/org/aspectj/weaver/World.java b/weaver/src/org/aspectj/weaver/World.java index 04ec34815..cdcac9fc5 100644 --- a/weaver/src/org/aspectj/weaver/World.java +++ b/weaver/src/org/aspectj/weaver/World.java @@ -137,7 +137,7 @@ public abstract class World implements Dump.INode { dumpState_cantFindTypeExceptions.add(new RuntimeException("Can't find type "+ty.getName())); } } - if (ty.isParameterized()) { + if (ty.isParameterized() && !ty.isRawType()) { for (int i = 0; i < ty.typeParameters.length; i++) { ty.typeParameters[i] = resolve(ty.typeParameters[i],allowMissing); } -- cgit v1.2.3