< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java

Print this page

        

*** 1926,1935 **** --- 1926,1936 ---- */ Symbol findFun(Env<AttrContext> env, Name name, List<Type> argtypes, List<Type> typeargtypes, boolean allowBoxing, boolean useVarargs) { Symbol bestSoFar = methodNotFound; + Env<AttrContext> env1 = env; boolean staticOnly = false; while (env1.outer != null) { if (isStatic(env1)) staticOnly = true; Assert.check(env1.info.preferredTreeForDiagnostics == null);
*** 2662,2672 **** Symbol resolveQualifiedMethod(DiagnosticPosition pos, Env<AttrContext> env, Symbol location, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) { return resolveQualifiedMethod(new MethodResolutionContext(), pos, env, location, site, name, argtypes, typeargtypes); } ! private Symbol resolveQualifiedMethod(MethodResolutionContext resolveContext, DiagnosticPosition pos, Env<AttrContext> env, Symbol location, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) { return lookupMethod(env, pos, location, resolveContext, new BasicLookupHelper(name, site, argtypes, typeargtypes) { @Override --- 2663,2673 ---- Symbol resolveQualifiedMethod(DiagnosticPosition pos, Env<AttrContext> env, Symbol location, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) { return resolveQualifiedMethod(new MethodResolutionContext(), pos, env, location, site, name, argtypes, typeargtypes); } ! public Symbol resolveQualifiedMethod(MethodResolutionContext resolveContext, DiagnosticPosition pos, Env<AttrContext> env, Symbol location, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) { return lookupMethod(env, pos, location, resolveContext, new BasicLookupHelper(name, site, argtypes, typeargtypes) { @Override
*** 2676,2686 **** phase.isVarargsRequired()); } @Override Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) { if (sym.kind.isResolutionError()) { ! sym = super.access(env, pos, location, sym); } else { MethodSymbol msym = (MethodSymbol)sym; if ((msym.flags() & SIGNATURE_POLYMORPHIC) != 0) { env.info.pendingResolutionPhase = BASIC; return findPolymorphicSignatureInstance(env, sym, argtypes); --- 2677,2687 ---- phase.isVarargsRequired()); } @Override Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) { if (sym.kind.isResolutionError()) { ! sym = resolveContext.silentFail ? sym : super.access(env, pos, location, sym); } else { MethodSymbol msym = (MethodSymbol)sym; if ((msym.flags() & SIGNATURE_POLYMORPHIC) != 0) { env.info.pendingResolutionPhase = BASIC; return findPolymorphicSignatureInstance(env, sym, argtypes);
*** 4791,4809 **** * overload resolution, such as list of method that are not applicable * (used to generate more precise diagnostics) and so on. Resolution contexts * can be nested - this means that when each overload resolution routine should * work within the resolution context it created. */ ! class MethodResolutionContext { private List<Candidate> candidates = List.nil(); MethodResolutionPhase step = null; MethodCheck methodCheck = resolveMethodCheck; ! private boolean internalResolution = false; private DeferredAttr.AttrMode attrMode = DeferredAttr.AttrMode.SPECULATIVE; void addInapplicableCandidate(Symbol sym, JCDiagnostic details) { Candidate c = new Candidate(currentResolutionContext.step, sym, details, null); candidates = candidates.append(c); --- 4792,4812 ---- * overload resolution, such as list of method that are not applicable * (used to generate more precise diagnostics) and so on. Resolution contexts * can be nested - this means that when each overload resolution routine should * work within the resolution context it created. */ ! public class MethodResolutionContext { private List<Candidate> candidates = List.nil(); MethodResolutionPhase step = null; MethodCheck methodCheck = resolveMethodCheck; ! public boolean internalResolution = false; ! // in case of failure, don't report the error ! public boolean silentFail = false; private DeferredAttr.AttrMode attrMode = DeferredAttr.AttrMode.SPECULATIVE; void addInapplicableCandidate(Symbol sym, JCDiagnostic details) { Candidate c = new Candidate(currentResolutionContext.step, sym, details, null); candidates = candidates.append(c);
< prev index next >