### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java,v retrieving revision 1.39 diff -u -r1.39 LocalVariableBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java 27 Apr 2007 15:51:38 -0000 1.39 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java 10 May 2007 16:06:12 -0000 @@ -65,23 +65,24 @@ // declaring method or type BlockScope scope = this.declaringScope; - MethodScope methodScope = scope instanceof MethodScope ? (MethodScope) scope : scope.enclosingMethodScope(); - ReferenceContext referenceContext = methodScope.referenceContext; - if (referenceContext instanceof AbstractMethodDeclaration) { - MethodBinding methodBinding = ((AbstractMethodDeclaration) referenceContext).binding; - if (methodBinding != null) { - buffer.append(methodBinding.computeUniqueKey(false/*not a leaf*/)); - } - } else if (referenceContext instanceof TypeDeclaration) { - TypeBinding typeBinding = ((TypeDeclaration) referenceContext).binding; - if (typeBinding != null) { - buffer.append(typeBinding.computeUniqueKey(false/*not a leaf*/)); + if (scope != null) { + MethodScope methodScope = scope instanceof MethodScope ? (MethodScope) scope : scope.enclosingMethodScope(); + ReferenceContext referenceContext = methodScope.referenceContext; + if (referenceContext instanceof AbstractMethodDeclaration) { + MethodBinding methodBinding = ((AbstractMethodDeclaration) referenceContext).binding; + if (methodBinding != null) { + buffer.append(methodBinding.computeUniqueKey(false/*not a leaf*/)); + } + } else if (referenceContext instanceof TypeDeclaration) { + TypeBinding typeBinding = ((TypeDeclaration) referenceContext).binding; + if (typeBinding != null) { + buffer.append(typeBinding.computeUniqueKey(false/*not a leaf*/)); + } } + + // scope index + getScopeKey(scope, buffer); } - - // scope index - getScopeKey(scope, buffer); - // variable name buffer.append('#'); buffer.append(this.name);