Skip to main content
summaryrefslogtreecommitdiffstats
blob: 3567686135d1a2b3acb19f7afe714c3576ea1e1e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*******************************************************************************
 * Copyright (c) 2000, 2014 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     Stephan Herrmann - Contribution for
 *								bug 384380 - False positive on a "Potential null pointer access" after a continue
 *								Bug 400874 - [1.8][compiler] Inference infrastructure should evolve to meet JLS8 18.x (Part G of JSR335 spec)
 *******************************************************************************/
package org.eclipse.jdt.internal.compiler.lookup;

import org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.eclipse.jdt.internal.compiler.ast.ExpressionContext;

public interface InvocationSite {

	TypeBinding[] genericTypeArguments();
	boolean isSuperAccess();
	boolean isTypeAccess();
	// in case the receiver type does not match the actual receiver type
	// e.g. pkg.Type.C (receiver type of C is type of source context,
	//		but actual receiver type is pkg.Type)
	// e.g2. in presence of implicit access to enclosing type
	void setActualReceiverType(ReferenceBinding receiverType);
	void setDepth(int depth);
	void setFieldIndex(int depth);
	int sourceEnd();
	int sourceStart();
	TypeBinding invocationTargetType();
	boolean receiverIsImplicitThis();
	/** When inference for this invocationSite starts, get a fresh inference context, initialized from this site. */
	InferenceContext18 freshInferenceContext(Scope scope);
	ExpressionContext getExpressionContext();
	
	static class EmptyWithAstNode implements InvocationSite {
		ASTNode node;
		public EmptyWithAstNode(ASTNode node) {
			this.node = node;
		}
		public TypeBinding[] genericTypeArguments() { return null;}
		public boolean isSuperAccess() {return false;}
		public boolean isTypeAccess() {return false;}
		public void setActualReceiverType(ReferenceBinding receiverType) {/* empty */}
		public void setDepth(int depth) {/* empty */ }
		public void setFieldIndex(int depth) {/* empty */ }
		public int sourceEnd() {return this.node.sourceEnd; }
		public int sourceStart() {return this.node.sourceStart; }
		public TypeBinding invocationTargetType() { return null; }
		public boolean receiverIsImplicitThis() { return false; }
		public InferenceContext18 freshInferenceContext(Scope scope) { return null; }
		public ExpressionContext getExpressionContext() { return ExpressionContext.VANILLA_CONTEXT; }
	}
}

Back to the top