From d0670c44eb69aeae547e2028b7ff629f2f0b0cb3 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 23 Jun 2010 19:29:19 +0000 Subject: [PATCH] when type parameter type cannot be found, dont return null, return problem binding --- .../compiler/lookup/EclipseFactory.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) 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 ae836a08c..c7d63fdf6 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 @@ -7,7 +7,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * PARC initial implementation + * PARC initial implementation * Mik Kersten 2004-07-26 extended to allow overloading of * hierarchy builder * ******************************************************************/ @@ -43,6 +43,8 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding; +import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemReasons; +import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.RawTypeBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope; @@ -601,17 +603,16 @@ public class EclipseFactory { if (ret == null) { ret = makeTypeBinding1(typeX); - if (!(typeX instanceof BoundedReferenceType) && !(typeX instanceof UnresolvedTypeVariableReferenceType)) { - if (typeX.isRawType()) { - rawTypeXToBinding.put(typeX, ret); - } else { - typexToBinding.put(typeX, ret); + if (ret != null) {// && !(ret instanceof ProblemReferenceBinding)) { + if (!(typeX instanceof BoundedReferenceType) && !(typeX instanceof UnresolvedTypeVariableReferenceType)) { + if (typeX.isRawType()) { + rawTypeXToBinding.put(typeX, ret); + } else { + typexToBinding.put(typeX, ret); + } } } } - if (ret == null) { - System.out.println("can't find: " + typeX); - } return ret; } @@ -746,6 +747,9 @@ public class EclipseFactory { private ReferenceBinding lookupBinding(String sname) { char[][] name = CharOperation.splitOn('.', sname.toCharArray()); ReferenceBinding rb = lookupEnvironment.getType(name); + if (rb == null && !sname.equals(UnresolvedType.MISSING_NAME)) { + return new ProblemReferenceBinding(name, null, ProblemReasons.NotFound); + } return rb; } -- 2.39.5