View | Details | Raw Unified | Return to bug 178861
Collapse All | Expand All

(-)eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java (-6 / +11 lines)
Lines 89-103 Link Here
89
		// implicit this
89
		// implicit this
90
		this.constant = Constant.NotAConstant;
90
		this.constant = Constant.NotAConstant;
91
		TypeBinding snippetType = null;
91
		TypeBinding snippetType = null;
92
		if (this.isImplicit || checkAccess(scope.methodScope())){
92
		MethodScope methodScope = scope.methodScope();
93
			snippetType = scope.enclosingSourceType();
93
		if (!this.isImplicit && !checkAccess(methodScope)) {
94
			return null;
94
		}
95
		}
95
		if (snippetType == null) return null;
96
		snippetType = scope.enclosingSourceType();
96
		
97
		
97
		this.delegateThis = scope.getField(snippetType, DELEGATE_THIS, this);
98
		this.delegateThis = scope.getField(snippetType, DELEGATE_THIS, this);
98
		if (this.delegateThis == null) return null; // internal error, field should have been found
99
		if (this.delegateThis == null || !this.delegateThis.isValidBinding()) {
99
		if (this.delegateThis.isValidBinding()) return this.resolvedType = this.delegateThis.type;
100
			// should not happen
100
		return this.resolvedType = snippetType;
101
			// if this happen we should report illegal access to this in a static context
102
			methodScope.problemReporter().errorThisSuperInStatic(this);
103
			return null;
104
		}
105
		return this.resolvedType = this.delegateThis.type;
101
	}
106
	}
102
	public void setActualReceiverType(ReferenceBinding receiverType) {
107
	public void setActualReceiverType(ReferenceBinding receiverType) {
103
		// ignored
108
		// ignored

Return to bug 178861