From 014c5c64b44c697946c4c7c21c18f273ab0e913b Mon Sep 17 00:00:00 2001 From: acolyer Date: Wed, 31 Aug 2005 12:25:47 +0000 Subject: tests for pr108454, 'Waving' crash on a 1.5 java generics? --- .../ajdt/internal/compiler/lookup/EclipseFactory.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'org.aspectj.ajdt.core') diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java index 576229bbc..07dc47a95 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java @@ -228,15 +228,24 @@ public class EclipseFactory { arguments[i] = fromBinding(ptb.arguments[i]); } } - ResolvedType baseType = UnresolvedType.forName(getName(binding)).resolve(getWorld()); + + String baseTypeSignature = null; + + ResolvedType baseType = getWorld().resolve(UnresolvedType.forName(getName(binding)),true); + if (baseType != ResolvedType.MISSING) { + // can legitimately be missing if a bound refers to a type we haven't added to the world yet... + if (!baseType.isGenericType() && arguments!=null) baseType = baseType.getGenericType(); + baseTypeSignature = baseType.getErasureSignature(); + } else { + baseTypeSignature = UnresolvedType.forName(getName(binding)).getSignature(); + } // Create an unresolved parameterized type. We can't create a resolved one as the // act of resolution here may cause recursion problems since the parameters may // be type variables that we haven't fixed up yet. - if (!baseType.isGenericType() && arguments!=null) baseType = baseType.getGenericType(); if (arguments==null) arguments=new UnresolvedType[0]; String parameterizedSig = ResolvedType.PARAMETERIZED_TYPE_IDENTIFIER+CharOperation.charToString(binding.genericTypeSignature()).substring(1); - return TypeFactory.createUnresolvedParameterizedType(parameterizedSig,baseType.getErasureSignature(),arguments); + return TypeFactory.createUnresolvedParameterizedType(parameterizedSig,baseTypeSignature,arguments); } // Convert the source type binding for a generic type into a generic UnresolvedType -- cgit v1.2.3