boolean (@NotNull PsiElement element, @NotNull ResolveState state) { if (myStopExecuting) { return false; } if (element instanceof PsiMethod method) { if (method.isConstructor() != myIsConstructor) return true; final PsiElement resolveContext = state.get(RESOLVE_CONTEXT); final SpreadState spreadState = state.get(SpreadState.SPREAD_STATE); final PsiSubstitutor partialSubstitutor = getSubstitutor(state); final NotNullComputable<PsiSubstitutor> substitutorComputer = () -> mySubstitutorComputer.obtainSubstitutor(partialSubstitutor, method, resolveContext); boolean isAccessible = isAccessible(method); boolean isStaticsOK = isStaticsOK(method, resolveContext, false); boolean isApplicable = PsiUtil.isApplicable(myArgumentTypes, method, partialSubstitutor, myPlace, true); boolean isValidResult = isStaticsOK && isAccessible && isApplicable; GroovyMethodResultImpl candidate = new GroovyMethodResultImpl( method, resolveContext, spreadState, partialSubstitutor, substitutorComputer, isAccessible, isStaticsOK, isValidResult ); if (!myAllVariants && isValidResult) { addCandidate(candidate); } else { addInapplicableCandidate(candidate); } } return true; }