| java.lang.Object com.sun.tools.javac.comp.Resolve
Resolve | public class Resolve (Code) | | Helper class for name resolution, used mostly by the attribution phase.
This is NOT part of any API supported by Sun Microsystems. If
you write code that depends on this, you do so at your own risk.
This code and its internal interfaces are subject to change or
deletion without notice.
|
Inner Class :class AccessError extends ResolveError | |
Inner Class :class StaticError extends ResolveError | |
Inner Class :class AmbiguityError extends ResolveError | |
Method Summary | |
static JCDiagnostic | absentKindName(int kind) A localized string describing the kind of a missing symbol, given an
error kind. | Symbol | access(Symbol sym, DiagnosticPosition pos, Type site, Name name, boolean qualified, List<Type> argtypes, List<Type> typeargtypes) If `sym' is a bad symbol: report error and return errSymbol
else pass through unchanged,
additional arguments duplicate what has been used in trying to find the
symbol (--> flyweight pattern). | Symbol | access(Symbol sym, DiagnosticPosition pos, Type site, Name name, boolean qualified) Same as above, but without type arguments and arguments. | boolean | argumentsAcceptable(List<Type> argtypes, List<Type> formals, boolean allowBoxing, boolean useVarargs, Warner warn) Check if a parameter list accepts a list of args. | void | checkNonAbstract(DiagnosticPosition pos, Symbol sym) Check that sym is not an abstract method. | Symbol | findField(Env<AttrContext> env, Type site, Name name, TypeSymbol c) Find field. | Symbol | findFun(Env<AttrContext> env, Name name, List<Type> argtypes, List<Type> typeargtypes, boolean allowBoxing, boolean useVarargs) Find unqualified method matching given name, type and value arguments. | Symbol | findGlobalType(Env<AttrContext> env, Scope scope, Name name) Find a global type in given scope and load corresponding class. | Symbol | findIdent(Env<AttrContext> env, Name name, int kind) Find an unqualified identifier which matches a specified kind set. | Symbol | findIdentInPackage(Env<AttrContext> env, TypeSymbol pck, Name name, int kind) Find an identifier in a package which matches a specified kind set. | Symbol | findIdentInType(Env<AttrContext> env, Type site, Name name, int kind) Find an identifier among the members of a given type `site'. | Symbol | findMemberType(Env<AttrContext> env, Type site, Name name, TypeSymbol c) Find qualified member type.
Parameters: env - The current environment. Parameters: site - The original type from where the selection takesplace. Parameters: name - The type's name. Parameters: c - The class to search for the member type. | Symbol | findMethod(Env<AttrContext> env, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes, boolean allowBoxing, boolean useVarargs, boolean operator) Find best qualified method matching given name, type and value
arguments. | Symbol | findType(Env<AttrContext> env, Name name) Find an unqualified type symbol. | Symbol | findVar(Env<AttrContext> env, Name name) Find unqualified variable or field with given name. | public static Resolve | instance(Context context) | Type | instantiate(Env<AttrContext> env, Type site, Symbol m, List<Type> argtypes, List<Type> typeargtypes, boolean allowBoxing, boolean useVarargs, Warner warn) | public boolean | isAccessible(Env<AttrContext> env, TypeSymbol c) | boolean | isAccessible(Env<AttrContext> env, Type t) | public boolean | isAccessible(Env<AttrContext> env, Type site, Symbol sym) | static boolean | isInitializer(Env<AttrContext> env) An environment is an "initializer" if it is a constructor or
an instance initializer. | static boolean | isStatic(Env<AttrContext> env) | static JCDiagnostic | kindName(int kind) A localized string describing a given kind. | static JCDiagnostic | kindName(Symbol sym) | static JCDiagnostic | kindNames(int kind) A localized string describing a given set of kinds. | Symbol | loadClass(Env<AttrContext> env, Name name) Load toplevel or member class with given fully qualified name and
verify that it is accessible. | public void | logAccessError(Env<AttrContext> env, JCTree tree, Type type) | Symbol | mostSpecific(Symbol m1, Symbol m2, Env<AttrContext> env, Type site, boolean allowBoxing, boolean useVarargs) | public void | printscopes(Scope s) print all scopes starting with scope s and proceeding outwards. | void | printscopes(Env<AttrContext> env) | public void | printscopes(Type t) | Type | rawInstantiate(Env<AttrContext> env, Type site, Symbol m, List<Type> argtypes, List<Type> typeargtypes, boolean allowBoxing, boolean useVarargs, Warner warn) Try to instantiate the type of a method so that it fits
given type arguments and argument types. | Symbol | resolveBinaryOperator(DiagnosticPosition pos, int optag, Env<AttrContext> env, Type left, Type right) Resolve binary operator. | Symbol | resolveConstructor(DiagnosticPosition pos, Env<AttrContext> env, Type site, List<Type> argtypes, List<Type> typeargtypes) Resolve constructor. | Symbol | resolveConstructor(DiagnosticPosition pos, Env<AttrContext> env, Type site, List<Type> argtypes, List<Type> typeargtypes, boolean allowBoxing, boolean useVarargs) Resolve constructor. | Symbol | resolveIdent(DiagnosticPosition pos, Env<AttrContext> env, Name name, int kind) Resolve an unqualified (non-method) identifier. | Type | resolveImplicitThis(DiagnosticPosition pos, Env<AttrContext> env, Type t) Resolve an appropriate implicit this instance for t's container. | public MethodSymbol | resolveInternalConstructor(DiagnosticPosition pos, Env<AttrContext> env, Type site, List<Type> argtypes, List<Type> typeargtypes) Resolve a constructor, throw a fatal error if not found. | public VarSymbol | resolveInternalField(DiagnosticPosition pos, Env<AttrContext> env, Type site, Name name) Resolve a field identifier, throw a fatal error if not found. | public MethodSymbol | resolveInternalMethod(DiagnosticPosition pos, Env<AttrContext> env, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) Resolve a qualified method identifier, throw a fatal error if not
found. | Symbol | resolveMethod(DiagnosticPosition pos, Env<AttrContext> env, Name name, List<Type> argtypes, List<Type> typeargtypes) Resolve an unqualified method identifier. | Symbol | resolveOperator(DiagnosticPosition pos, int optag, Env<AttrContext> env, List<Type> argtypes) Resolve operator. | Symbol | resolveQualifiedMethod(DiagnosticPosition pos, Env<AttrContext> env, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) | Symbol | resolveSelf(DiagnosticPosition pos, Env<AttrContext> env, TypeSymbol c, Name name) Resolve `c.name' where name == this or name == super. | Symbol | resolveSelfContaining(DiagnosticPosition pos, Env<AttrContext> env, Symbol member) Resolve `c.this' for an enclosing class c that contains the
named member. | Symbol | resolveUnaryOperator(DiagnosticPosition pos, int optag, Env<AttrContext> env, Type arg) Resolve operator. | Symbol | selectBest(Env<AttrContext> env, Type site, List<Type> argtypes, List<Type> typeargtypes, Symbol sym, Symbol bestSoFar, boolean allowBoxing, boolean useVarargs, boolean operator) Select the best method for a call site among two choices. | static JCDiagnostic | typeKindName(Type t) A localized string describing the kind -- either class or interface --
of a given type. |
boxingEnabled | final public boolean boxingEnabled(Code) | | |
methodNotFound | final ResolveError methodNotFound(Code) | | |
typeNotFound | final ResolveError typeNotFound(Code) | | |
varNotFound | final ResolveError varNotFound(Code) | | error symbols, which are returned when resolution fails
|
varargsEnabled | final public boolean varargsEnabled(Code) | | |
wrongMethod | final ResolveError wrongMethod(Code) | | |
wrongMethods | final ResolveError wrongMethods(Code) | | |
absentKindName | static JCDiagnostic absentKindName(int kind)(Code) | | A localized string describing the kind of a missing symbol, given an
error kind.
|
access | Symbol access(Symbol sym, DiagnosticPosition pos, Type site, Name name, boolean qualified, List<Type> argtypes, List<Type> typeargtypes)(Code) | | If `sym' is a bad symbol: report error and return errSymbol
else pass through unchanged,
additional arguments duplicate what has been used in trying to find the
symbol (--> flyweight pattern). This improves performance since we
expect misses to happen frequently.
Parameters: sym - The symbol that was found, or a ResolveError. Parameters: pos - The position to use for error reporting. Parameters: site - The original type from where the selection took place. Parameters: name - The symbol's name. Parameters: argtypes - The invocation's value arguments,if we looked for a method. Parameters: typeargtypes - The invocation's type arguments,if we looked for a method. |
access | Symbol access(Symbol sym, DiagnosticPosition pos, Type site, Name name, boolean qualified)(Code) | | Same as above, but without type arguments and arguments.
|
argumentsAcceptable | boolean argumentsAcceptable(List<Type> argtypes, List<Type> formals, boolean allowBoxing, boolean useVarargs, Warner warn)(Code) | | Check if a parameter list accepts a list of args.
|
checkNonAbstract | void checkNonAbstract(DiagnosticPosition pos, Symbol sym)(Code) | | Check that sym is not an abstract method.
|
findField | Symbol findField(Env<AttrContext> env, Type site, Name name, TypeSymbol c)(Code) | | Find field. Synthetic fields are always skipped.
Parameters: env - The current environment. Parameters: site - The original type from where the selection takes place. Parameters: name - The name of the field. Parameters: c - The class to search for the field. This is alwaysa superclass or implemented interface of site's class. |
findFun | Symbol findFun(Env<AttrContext> env, Name name, List<Type> argtypes, List<Type> typeargtypes, boolean allowBoxing, boolean useVarargs)(Code) | | Find unqualified method matching given name, type and value arguments.
Parameters: env - The current environment. Parameters: name - The method's name. Parameters: argtypes - The method's value arguments. Parameters: typeargtypes - The method's type arguments. Parameters: allowBoxing - Allow boxing conversions of arguments. Parameters: useVarargs - Box trailing arguments into an array for varargs. |
findGlobalType | Symbol findGlobalType(Env<AttrContext> env, Scope scope, Name name)(Code) | | Find a global type in given scope and load corresponding class.
Parameters: env - The current environment. Parameters: scope - The scope in which to look for the type. Parameters: name - The type's name. |
findIdent | Symbol findIdent(Env<AttrContext> env, Name name, int kind)(Code) | | Find an unqualified identifier which matches a specified kind set.
Parameters: env - The current environment. Parameters: name - The indentifier's name. Parameters: kind - Indicates the possible symbol kinds(a subset of VAL, TYP, PCK). |
findIdentInPackage | Symbol findIdentInPackage(Env<AttrContext> env, TypeSymbol pck, Name name, int kind)(Code) | | Find an identifier in a package which matches a specified kind set.
Parameters: env - The current environment. Parameters: name - The identifier's name. Parameters: kind - Indicates the possible symbol kinds(a nonempty subset of TYP, PCK). |
findIdentInType | Symbol findIdentInType(Env<AttrContext> env, Type site, Name name, int kind)(Code) | | Find an identifier among the members of a given type `site'.
Parameters: env - The current environment. Parameters: site - The type containing the symbol to be found. Parameters: name - The identifier's name. Parameters: kind - Indicates the possible symbol kinds(a subset of VAL, TYP). |
findMemberType | Symbol findMemberType(Env<AttrContext> env, Type site, Name name, TypeSymbol c)(Code) | | Find qualified member type.
Parameters: env - The current environment. Parameters: site - The original type from where the selection takesplace. Parameters: name - The type's name. Parameters: c - The class to search for the member type. This isalways a superclass or implemented interface ofsite's class. |
findMethod | Symbol findMethod(Env<AttrContext> env, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes, boolean allowBoxing, boolean useVarargs, boolean operator)(Code) | | Find best qualified method matching given name, type and value
arguments.
Parameters: env - The current environment. Parameters: site - The original type from where the selectiontakes place. Parameters: name - The method's name. Parameters: argtypes - The method's value arguments. Parameters: typeargtypes - The method's type arguments Parameters: allowBoxing - Allow boxing conversions of arguments. Parameters: useVarargs - Box trailing arguments into an array for varargs. |
findType | Symbol findType(Env<AttrContext> env, Name name)(Code) | | Find an unqualified type symbol.
Parameters: env - The current environment. Parameters: name - The type's name. |
findVar | Symbol findVar(Env<AttrContext> env, Name name)(Code) | | Find unqualified variable or field with given name.
Synthetic fields always skipped.
Parameters: env - The current environment. Parameters: name - The name of the variable or field. |
isAccessible | public boolean isAccessible(Env<AttrContext> env, TypeSymbol c)(Code) | | Is class accessible in given evironment?
Parameters: env - The current environment. Parameters: c - The class whose accessibility is checked. |
isAccessible | public boolean isAccessible(Env<AttrContext> env, Type site, Symbol sym)(Code) | | Is symbol accessible as a member of given type in given evironment?
Parameters: env - The current environment. Parameters: site - The type of which the tested symbol is regardedas a member. Parameters: sym - The symbol. |
isInitializer | static boolean isInitializer(Env<AttrContext> env)(Code) | | An environment is an "initializer" if it is a constructor or
an instance initializer.
|
isStatic | static boolean isStatic(Env<AttrContext> env)(Code) | | An environment is "static" if its static level is greater than
the one of its outer environment
|
kindName | static JCDiagnostic kindName(int kind)(Code) | | A localized string describing a given kind.
|
kindNames | static JCDiagnostic kindNames(int kind)(Code) | | A localized string describing a given set of kinds.
|
loadClass | Symbol loadClass(Env<AttrContext> env, Name name)(Code) | | Load toplevel or member class with given fully qualified name and
verify that it is accessible.
Parameters: env - The current environment. Parameters: name - The fully qualified name of the class to be loaded. |
printscopes | public void printscopes(Scope s)(Code) | | print all scopes starting with scope s and proceeding outwards.
used for debugging.
|
rawInstantiate | Type rawInstantiate(Env<AttrContext> env, Type site, Symbol m, List<Type> argtypes, List<Type> typeargtypes, boolean allowBoxing, boolean useVarargs, Warner warn) throws Infer.NoInstanceException(Code) | | Try to instantiate the type of a method so that it fits
given type arguments and argument types. If succesful, return
the method's instantiated type, else return null.
The instantiation will take into account an additional leading
formal parameter if the method is an instance method seen as a member
of un underdetermined site In this case, we treat site as an additional
parameter and the parameters of the class containing the method as
additional type variables that get instantiated.
Parameters: env - The current environment Parameters: site - The type of which the method is a member. Parameters: m - The method symbol. Parameters: argtypes - The invocation's given value arguments. Parameters: typeargtypes - The invocation's given type arguments. Parameters: allowBoxing - Allow boxing conversions of arguments. Parameters: useVarargs - Box trailing arguments into an array for varargs. |
resolveBinaryOperator | Symbol resolveBinaryOperator(DiagnosticPosition pos, int optag, Env<AttrContext> env, Type left, Type right)(Code) | | Resolve binary operator.
Parameters: pos - The position to use for error reporting. Parameters: optag - The tag of the operation tree. Parameters: env - The environment current at the operation. Parameters: left - The types of the left operand. Parameters: right - The types of the right operand. |
resolveConstructor | Symbol resolveConstructor(DiagnosticPosition pos, Env<AttrContext> env, Type site, List<Type> argtypes, List<Type> typeargtypes)(Code) | | Resolve constructor.
Parameters: pos - The position to use for error reporting. Parameters: env - The environment current at the constructor invocation. Parameters: site - The type of class for which a constructor is searched. Parameters: argtypes - The types of the constructor invocation's valuearguments. Parameters: typeargtypes - The types of the constructor invocation's typearguments. |
resolveConstructor | Symbol resolveConstructor(DiagnosticPosition pos, Env<AttrContext> env, Type site, List<Type> argtypes, List<Type> typeargtypes, boolean allowBoxing, boolean useVarargs)(Code) | | Resolve constructor.
Parameters: pos - The position to use for error reporting. Parameters: env - The environment current at the constructor invocation. Parameters: site - The type of class for which a constructor is searched. Parameters: argtypes - The types of the constructor invocation's valuearguments. Parameters: typeargtypes - The types of the constructor invocation's typearguments. Parameters: allowBoxing - Allow boxing and varargs conversions. Parameters: useVarargs - Box trailing arguments into an array for varargs. |
resolveIdent | Symbol resolveIdent(DiagnosticPosition pos, Env<AttrContext> env, Name name, int kind)(Code) | | Resolve an unqualified (non-method) identifier.
Parameters: pos - The position to use for error reporting. Parameters: env - The environment current at the identifier use. Parameters: name - The identifier's name. Parameters: kind - The set of admissible symbol kinds for the identifier. |
resolveImplicitThis | Type resolveImplicitThis(DiagnosticPosition pos, Env<AttrContext> env, Type t)(Code) | | Resolve an appropriate implicit this instance for t's container.
JLS2 8.8.5.1 and 15.9.2
|
resolveInternalConstructor | public MethodSymbol resolveInternalConstructor(DiagnosticPosition pos, Env<AttrContext> env, Type site, List<Type> argtypes, List<Type> typeargtypes)(Code) | | Resolve a constructor, throw a fatal error if not found.
Parameters: pos - The position to use for error reporting. Parameters: env - The environment current at the method invocation. Parameters: site - The type to be constructed. Parameters: argtypes - The types of the invocation's value arguments. Parameters: typeargtypes - The types of the invocation's type arguments. |
resolveInternalField | public VarSymbol resolveInternalField(DiagnosticPosition pos, Env<AttrContext> env, Type site, Name name)(Code) | | Resolve a field identifier, throw a fatal error if not found.
Parameters: pos - The position to use for error reporting. Parameters: env - The environment current at the method invocation. Parameters: site - The type of the qualifying expression, in whichidentifier is searched. Parameters: name - The identifier's name. |
resolveInternalMethod | public MethodSymbol resolveInternalMethod(DiagnosticPosition pos, Env<AttrContext> env, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes)(Code) | | Resolve a qualified method identifier, throw a fatal error if not
found.
Parameters: pos - The position to use for error reporting. Parameters: env - The environment current at the method invocation. Parameters: site - The type of the qualifying expression, in whichidentifier is searched. Parameters: name - The identifier's name. Parameters: argtypes - The types of the invocation's value arguments. Parameters: typeargtypes - The types of the invocation's type arguments. |
resolveMethod | Symbol resolveMethod(DiagnosticPosition pos, Env<AttrContext> env, Name name, List<Type> argtypes, List<Type> typeargtypes)(Code) | | Resolve an unqualified method identifier.
Parameters: pos - The position to use for error reporting. Parameters: env - The environment current at the method invocation. Parameters: name - The identifier's name. Parameters: argtypes - The types of the invocation's value arguments. Parameters: typeargtypes - The types of the invocation's type arguments. |
resolveOperator | Symbol resolveOperator(DiagnosticPosition pos, int optag, Env<AttrContext> env, List<Type> argtypes)(Code) | | Resolve operator.
Parameters: pos - The position to use for error reporting. Parameters: optag - The tag of the operation tree. Parameters: env - The environment current at the operation. Parameters: argtypes - The types of the operands. |
resolveQualifiedMethod | Symbol resolveQualifiedMethod(DiagnosticPosition pos, Env<AttrContext> env, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes)(Code) | | Resolve a qualified method identifier
Parameters: pos - The position to use for error reporting. Parameters: env - The environment current at the method invocation. Parameters: site - The type of the qualifying expression, in whichidentifier is searched. Parameters: name - The identifier's name. Parameters: argtypes - The types of the invocation's value arguments. Parameters: typeargtypes - The types of the invocation's type arguments. |
resolveSelf | Symbol resolveSelf(DiagnosticPosition pos, Env<AttrContext> env, TypeSymbol c, Name name)(Code) | | Resolve `c.name' where name == this or name == super.
Parameters: pos - The position to use for error reporting. Parameters: env - The environment current at the expression. Parameters: c - The qualifier. Parameters: name - The identifier's name. |
resolveSelfContaining | Symbol resolveSelfContaining(DiagnosticPosition pos, Env<AttrContext> env, Symbol member)(Code) | | Resolve `c.this' for an enclosing class c that contains the
named member.
Parameters: pos - The position to use for error reporting. Parameters: env - The environment current at the expression. Parameters: member - The member that must be contained in the result. |
resolveUnaryOperator | Symbol resolveUnaryOperator(DiagnosticPosition pos, int optag, Env<AttrContext> env, Type arg)(Code) | | Resolve operator.
Parameters: pos - The position to use for error reporting. Parameters: optag - The tag of the operation tree. Parameters: env - The environment current at the operation. Parameters: arg - The type of the operand. |
selectBest | Symbol selectBest(Env<AttrContext> env, Type site, List<Type> argtypes, List<Type> typeargtypes, Symbol sym, Symbol bestSoFar, boolean allowBoxing, boolean useVarargs, boolean operator)(Code) | | Select the best method for a call site among two choices.
Parameters: env - The current environment. Parameters: site - The original type from where theselection takes place. Parameters: argtypes - The invocation's value arguments, Parameters: typeargtypes - The invocation's type arguments, Parameters: sym - Proposed new best match. Parameters: bestSoFar - Previously found best match. Parameters: allowBoxing - Allow boxing conversions of arguments. Parameters: useVarargs - Box trailing arguments into an array for varargs. |
typeKindName | static JCDiagnostic typeKindName(Type t)(Code) | | A localized string describing the kind -- either class or interface --
of a given type.
|
|
|