Source:
<code><START> private Resolution selectBest(Env env, JavaType site, List<JavaType> argTypes, List<JavaType> typeParams, JavaSymbol candidate, Resolution bestSoFar, boolean autoboxing) { <END> JavaSymbol.TypeJavaSymbol siteSymbol = site.symbol; if (candidate.kind >= JavaSymbol.ERRONEOUS || !isInheritedIn(candidate, siteSymbol) || candidate.type == null) { return bestSoFar; } JavaSymbol.MethodJavaSymbol methodJavaSymbol = (JavaSymbol.MethodJavaSymbol) candidate; if(!hasCompatibleArity(methodJavaSymbol.parameterTypes().size(), argTypes.size(), methodJavaSymbol.isVarArgs())) { return bestSoFar; } List<JavaType> formals = ((JavaType.MethodJavaType) methodJavaSymbol.type).argTypes; formals = typeSubstitutionSolver.applySiteSubstitutionToFormalParameters(formals, site); TypeSubstitution substitution = typeSubstitutionSolver.getTypeSubstitution(methodJavaSymbol, site, typeParams, argTypes); if (substitution == null) { return bestSoFar; } formals = typeSubstitutionSolver.applySubstitutionToFormalParameters(formals, substitution); if (!isArgumentsAcceptable(argTypes, formals, methodJavaSymbol.isVarArgs(), autoboxing)) { return bestSoFar; } if (!isAccessible(env, siteSymbol, candidate)) { return new Resolution(new AccessErrorJavaSymbol(candidate, Symbols.unknownType)); } JavaSymbol mostSpecific = selectMostSpecific(candidate, bestSoFar.symbol, substitution); if (mostSpecific.isKind(JavaSymbol.AMBIGUOUS)) { return bestSoFar; } Resolution resolution = new Resolution(mostSpecific); resolution.type = typeSubstitutionSolver.getReturnType((JavaSymbol.MethodJavaSymbol) mostSpecific, site, typeParams, substitution); return resolution; }</code><technical_language>![MAJOR](<LINK_0> Reduce number of returns of this method 7, maximum allowed 5. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
private Resolution selectBest(Env env, JavaType site, List<JavaType> argTypes, List<JavaType> typeParams, JavaSymbol candidate, Resolution bestSoFar, boolean autoboxing) { JavaSymbol.TypeJavaSymbol siteSymbol = site.symbol; if (candidate.kind >= JavaSymbol.ERRONEOUS || !isInheritedIn(candidate, siteSymbol) || candidate.type == null) { return bestSoFar; } JavaSymbol.MethodJavaSymbol methodJavaSymbol = (JavaSymbol.MethodJavaSymbol) candidate; if(!hasCompatibleArity(methodJavaSymbol.parameterTypes().size(), argTypes.size(), methodJavaSymbol.isVarArgs())) { return bestSoFar; } TypeSubstitution substitution = typeSubstitutionSolver.getTypeSubstitution(methodJavaSymbol, site, typeParams, argTypes); if (substitution == null) { return bestSoFar; } List<JavaType> formals = ((JavaType.MethodJavaType) methodJavaSymbol.type).argTypes; formals = typeSubstitutionSolver.applySiteSubstitutionToFormalParameters(formals, site); formals = typeSubstitutionSolver.applySubstitutionToFormalParameters(formals, substitution); if (!isArgumentsAcceptable(argTypes, formals, methodJavaSymbol.isVarArgs(), autoboxing)) { return bestSoFar; } if (!isAccessible(env, siteSymbol, candidate)) { Resolution resolution = new Resolution(new AccessErrorJavaSymbol(candidate, Symbols.unknownType)); resolution.type = Symbols.unknownType; return resolution; } JavaSymbol mostSpecific = selectMostSpecific(candidate, bestSoFar.symbol, substitution); if (mostSpecific.isKind(JavaSymbol.AMBIGUOUS)) { return bestSoFar; } Resolution resolution = new Resolution(mostSpecific); JavaType resturnType = ((JavaType.MethodJavaType) ((JavaSymbol.MethodJavaSymbol) mostSpecific).type).resultType; resolution.type = typeSubstitutionSolver.getReturnType(resturnType, site, !typeParams.isEmpty(), substitution); return resolution; }