View | Details | Raw Unified | Return to bug 185129 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java (-15 / +17 lines)
Lines 65-87 Link Here
65
		
65
		
66
		// declaring method or type
66
		// declaring method or type
67
		BlockScope scope = this.declaringScope;
67
		BlockScope scope = this.declaringScope;
68
		MethodScope methodScope = scope instanceof MethodScope ? (MethodScope) scope : scope.enclosingMethodScope();
68
		if (scope != null) {
69
		ReferenceContext referenceContext = methodScope.referenceContext;
69
			// the scope can be null. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=185129
70
		if (referenceContext instanceof AbstractMethodDeclaration) {
70
			MethodScope methodScope = scope instanceof MethodScope ? (MethodScope) scope : scope.enclosingMethodScope();
71
			MethodBinding methodBinding = ((AbstractMethodDeclaration) referenceContext).binding;
71
			ReferenceContext referenceContext = methodScope.referenceContext;
72
			if (methodBinding != null) {
72
			if (referenceContext instanceof AbstractMethodDeclaration) {
73
				buffer.append(methodBinding.computeUniqueKey(false/*not a leaf*/));
73
				MethodBinding methodBinding = ((AbstractMethodDeclaration) referenceContext).binding;
74
			}
74
				if (methodBinding != null) {
75
		} else if (referenceContext instanceof TypeDeclaration) {
75
					buffer.append(methodBinding.computeUniqueKey(false/*not a leaf*/));
76
			TypeBinding typeBinding = ((TypeDeclaration) referenceContext).binding;
76
				}
77
			if (typeBinding != null) {
77
			} else if (referenceContext instanceof TypeDeclaration) {
78
				buffer.append(typeBinding.computeUniqueKey(false/*not a leaf*/));
78
				TypeBinding typeBinding = ((TypeDeclaration) referenceContext).binding;
79
				if (typeBinding != null) {
80
					buffer.append(typeBinding.computeUniqueKey(false/*not a leaf*/));
81
				}
79
			}
82
			}
83
	
84
			// scope index
85
			getScopeKey(scope, buffer);
80
		}
86
		}
81
82
		// scope index
83
		getScopeKey(scope, buffer);
84
85
		// variable name
87
		// variable name
86
		buffer.append('#');
88
		buffer.append('#');
87
		buffer.append(this.name);
89
		buffer.append(this.name);

Return to bug 185129