boolean operator) { Symbol bestSoFar = methodNotFound; bestSoFar = findMethod(env, site, name,
boolean useVarargs, boolean operator) { return findMethod(env, site, name,
boolean useVarargs, boolean operator) { return findMethod(env, site, name,
boolean operator) { Symbol bestSoFar = methodNotFound; bestSoFar = findMethod(env, site, name,
/** Resolve a qualified method identifier * @param pos The position to use for error reporting. * @param env The environment current at the method invocation. * @param site The type of the qualifying expression, in which * identifier is searched. * @param name The identifier's name. * @param argtypes The types of the invocation's value arguments. * @param typeargtypes The types of the invocation's type arguments. */ Symbol resolveQualifiedMethod(DiagnosticPosition pos, Env<AttrContext> env, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) { Symbol sym = findMethod(env, site, name, argtypes, typeargtypes, false, env.info.varArgs=false, false); if (varargsEnabled && sym.kind >= WRONG_MTHS) { sym = findMethod(env, site, name, argtypes, typeargtypes, true, false, false); if (sym.kind >= WRONG_MTHS) sym = findMethod(env, site, name, argtypes, typeargtypes, true, env.info.varArgs=true, false); } if (sym.kind >= AMBIGUOUS) { sym = access(sym, pos, site, name, true, argtypes, typeargtypes); } return sym; }
Symbol findConstructor(DiagnosticPosition pos, Env<AttrContext> env, Type site, List<Type> argtypes, List<Type> typeargtypes, boolean allowBoxing, boolean useVarargs) { Symbol sym = findMethod(env, site, names.init, argtypes, typeargtypes, allowBoxing, useVarargs, false); chk.checkDeprecated(pos, env.info.scope.owner, sym); return sym; }
/** Resolve a qualified method identifier * @param pos The position to use for error reporting. * @param env The environment current at the method invocation. * @param site The type of the qualifying expression, in which * identifier is searched. * @param name The identifier's name. * @param argtypes The types of the invocation's value arguments. * @param typeargtypes The types of the invocation's type arguments. */ Symbol resolveQualifiedMethod(DiagnosticPosition pos, Env<AttrContext> env, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) { Symbol sym = findMethod(env, site, name, argtypes, typeargtypes, false, env.info.varArgs=false, false); if (varargsEnabled && sym.kind >= WRONG_MTHS) { sym = findMethod(env, site, name, argtypes, typeargtypes, true, false, false); if (sym.kind >= WRONG_MTHS) sym = findMethod(env, site, name, argtypes, typeargtypes, true, env.info.varArgs=true, false); } if (sym.kind >= AMBIGUOUS) { sym = access(sym, pos, site, name, true, argtypes, typeargtypes); } return sym; }
Symbol findConstructor(DiagnosticPosition pos, Env<AttrContext> env, Type site, List<Type> argtypes, List<Type> typeargtypes, boolean allowBoxing, boolean useVarargs) { Symbol sym = findMethod(env, site, names.init, argtypes, typeargtypes, allowBoxing, useVarargs, false); chk.checkDeprecated(pos, env.info.scope.owner, sym); return sym; }
/** Resolve operator. * @param pos The position to use for error reporting. * @param optag The tag of the operation tree. * @param env The environment current at the operation. * @param argtypes The types of the operands. */ Symbol resolveOperator(DiagnosticPosition pos, int optag, Env<AttrContext> env, List<Type> argtypes) { Name name = treeinfo.operatorName(optag); Symbol sym = findMethod(env, syms.predefClass.type, name, argtypes, null, false, false, true); if (boxingEnabled && sym.kind >= WRONG_MTHS) sym = findMethod(env, syms.predefClass.type, name, argtypes, null, true, false, true); return access(sym, pos, env.enclClass.sym.type, name, false, argtypes, null); }
/** Resolve operator. * @param pos The position to use for error reporting. * @param optag The tag of the operation tree. * @param env The environment current at the operation. * @param argtypes The types of the operands. */ Symbol resolveOperator(DiagnosticPosition pos, int optag, Env<AttrContext> env, List<Type> argtypes) { Name name = treeinfo.operatorName(optag); Symbol sym = findMethod(env, syms.predefClass.type, name, argtypes, null, false, false, true); if (boxingEnabled && sym.kind >= WRONG_MTHS) sym = findMethod(env, syms.predefClass.type, name, argtypes, null, true, false, true); return access(sym, pos, env.enclClass.sym.type, name, false, argtypes, null); }
@Override final Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) { return findMethod(env, site, name, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired(), syms.operatorNames.contains(name)); }
@Override final Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) { return findMethod(env, site, name, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired(), syms.operatorNames.contains(name)); }
@Override protected Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) { Symbol sym = needsInference ? findDiamond(env, site, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired()) : findMethod(env, site, name, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired(), syms.operatorNames.contains(name)); return sym.kind != MTH || site.getEnclosingType().hasTag(NONE) || hasEnclosingInstance(env, site) ? sym : new InvalidSymbolError(Kinds.MISSING_ENCL, sym, null) { @Override JCDiagnostic getDiagnostic(DiagnosticType dkind, DiagnosticPosition pos, Symbol location, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) { return diags.create(dkind, log.currentSource(), pos, "cant.access.inner.cls.constr", site.tsym.name, argtypes, site.getEnclosingType()); } }; }
@Override protected Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) { Symbol sym = needsInference ? findDiamond(env, site, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired()) : findMethod(env, site, name, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired(), syms.operatorNames.contains(name)); return sym.kind != MTH || site.getEnclosingType().hasTag(NONE) || hasEnclosingInstance(env, site) ? sym : new InvalidSymbolError(Kinds.MISSING_ENCL, sym, null) { @Override JCDiagnostic getDiagnostic(DiagnosticType dkind, DiagnosticPosition pos, Symbol location, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) { return diags.create(dkind, log.currentSource(), pos, "cant.access.inner.cls.constr", site.tsym.name, argtypes, site.getEnclosingType()); } }; }
/** Resolve constructor. * @param pos The position to use for error reporting. * @param env The environment current at the constructor invocation. * @param site The type of class for which a constructor is searched. * @param argtypes The types of the constructor invocation's value * arguments. * @param typeargtypes The types of the constructor invocation's type * arguments. * @param allowBoxing Allow boxing and varargs conversions. * @param useVarargs Box trailing arguments into an array for varargs. */ Symbol resolveConstructor(DiagnosticPosition pos, Env<AttrContext> env, Type site, List<Type> argtypes, List<Type> typeargtypes, boolean allowBoxing, boolean useVarargs) { Symbol sym = findMethod(env, site, names.init, argtypes, typeargtypes, allowBoxing, useVarargs, false); if ((sym.flags() & DEPRECATED) != 0 && (env.info.scope.owner.flags() & DEPRECATED) == 0 && env.info.scope.owner.outermostClass() != sym.outermostClass()) chk.warnDeprecated(pos, sym); return sym; }
/** Resolve constructor. * @param pos The position to use for error reporting. * @param env The environment current at the constructor invocation. * @param site The type of class for which a constructor is searched. * @param argtypes The types of the constructor invocation's value * arguments. * @param typeargtypes The types of the constructor invocation's type * arguments. * @param allowBoxing Allow boxing and varargs conversions. * @param useVarargs Box trailing arguments into an array for varargs. */ Symbol resolveConstructor(DiagnosticPosition pos, Env<AttrContext> env, Type site, List<Type> argtypes, List<Type> typeargtypes, boolean allowBoxing, boolean useVarargs) { Symbol sym = findMethod(env, site, names.init, argtypes, typeargtypes, allowBoxing, useVarargs, false); if ((sym.flags() & DEPRECATED) != 0 && (env.info.scope.owner.flags() & DEPRECATED) == 0 && env.info.scope.owner.outermostClass() != sym.outermostClass()) chk.warnDeprecated(pos, sym); return sym; }
while (env1.outer != null) { if (isStatic(env1)) staticOnly = true; sym = findMethod( env1, env1.enclClass.sym.type, name, argtypes, typeargtypes, allowBoxing, useVarargs, false); sym = findMethod(env, syms.predefClass.type, name, argtypes, typeargtypes, allowBoxing, useVarargs, false); if (sym.exists())
env1.info.preferredTreeForDiagnostics = env.tree; try { sym = findMethod( env1, env1.enclClass.sym.type, name, argtypes, typeargtypes, allowBoxing, useVarargs, false); sym = findMethod(env, syms.predefClass.type, name, argtypes, typeargtypes, allowBoxing, useVarargs, false); if (sym.exists())
while (env1.outer != null) { if (isStatic(env1)) staticOnly = true; sym = findMethod( env1, env1.enclClass.sym.type, name, argtypes, typeargtypes, allowBoxing, useVarargs, false); sym = findMethod(env, syms.predefClass.type, name, argtypes, typeargtypes, allowBoxing, useVarargs, false); if (sym.exists())
while (env1.outer != null) { if (isStatic(env1)) staticOnly = true; sym = findMethod( env1, env1.enclClass.sym.type, name, argtypes, typeargtypes, allowBoxing, useVarargs, false); sym = findMethod(env, syms.predefClass.type, name, argtypes, typeargtypes, allowBoxing, useVarargs, false); if (sym.exists())