From 39fd6de06487242aad870f7346ef3e948f26ab9c Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 2 Nov 2009 01:41:39 +0000 Subject: [PATCH] better checking of type --- .../src/org/aspectj/weaver/TypeFactory.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java b/org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java index 25ae2f40e..0d2892f12 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java @@ -90,9 +90,9 @@ public class TypeFactory { * Used by UnresolvedType.read, creates a type from a full signature. */ public static UnresolvedType createTypeFromSignature(String signature) { - if (signature.equals(ResolvedType.MISSING_NAME)) { - return ResolvedType.MISSING; - } + // if (signature.equals(ResolvedType.MISSING_NAME)) { + // return ResolvedType.MISSING; + // } char firstChar = signature.charAt(0); if (firstChar == 'P') { @@ -138,7 +138,7 @@ public class TypeFactory { return new UnresolvedType(signature, signatureErasure, typeParams); } // can't replace above with convertSigToType - leads to stackoverflow - } else if (signature.equals("?") || signature.equals("*")) { + } else if ((firstChar == '?' || firstChar == '*') && signature.length() == 1) { return WildcardedUnresolvedType.QUESTIONMARK; } else if (firstChar == '+') { // ? extends ... @@ -165,6 +165,7 @@ public class TypeFactory { return new UnresolvedType(signature, signature.substring(0, dims) + componentType.getErasureSignature()); } else if (signature.length() == 1) { // could be a primitive switch (firstChar) { + case 'V': return ResolvedType.VOID; case 'Z': @@ -184,6 +185,9 @@ public class TypeFactory { case 'S': return ResolvedType.SHORT; } + } else if (firstChar == '@') { + // missing type + return ResolvedType.MISSING; } return new UnresolvedType(signature); } -- 2.39.5