### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v retrieving revision 1.313 diff -u -r1.313 Scope.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 24 Sep 2007 22:49:54 -0000 1.313 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 25 Sep 2007 17:39:26 -0000 @@ -2254,9 +2254,13 @@ case METHOD_SCOPE : MethodScope methodScope = (MethodScope) scope; AbstractMethodDeclaration methodDecl = methodScope.referenceMethod(); - if (methodDecl != null && methodDecl.binding != null) { - TypeVariableBinding typeVariable = methodDecl.binding.getTypeVariable(name); - if (typeVariable != null) return typeVariable; + if (methodDecl != null) { + // use the methodDecl's typeParameters to handle problem cases when the method binding doesn't exist + TypeParameter[] params = methodDecl.typeParameters(); + for (int i = params == null ? 0 : params.length; --i >= 0;) + if (CharOperation.equals(params[i].name, name)) + if (params[i].binding != null && params[i].binding.isValidBinding()) + return params[i].binding; } insideStaticContext |= methodScope.isStatic; insideTypeAnnotation = methodScope.insideTypeAnnotation;