<commit_before>package org.innovateuk.ifs.application.validation;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.innovateuk.ifs.application.domain.Application;
import org.innovateuk.ifs.application.domain.FormInputResponse;
import org.innovateuk.ifs.application.validator.ApplicationDetailsMarkAsCompleteValidator;
import org.innovateuk.ifs.application.validator.ApplicationResearchMarkAsCompleteValidator;
import org.innovateuk.ifs.application.validator.ApplicationTeamMarkAsCompleteValidator;
import org.innovateuk.ifs.application.validator.NotEmptyValidator;
import org.innovateuk.ifs.commons.error.ValidationMessages;
import org.innovateuk.ifs.finance.resource.cost.FinanceRowType;
import org.innovateuk.ifs.form.domain.FormInput;
import org.innovateuk.ifs.form.domain.FormValidator;
import org.innovateuk.ifs.form.domain.Question;
import org.innovateuk.ifs.form.domain.Section;
import org.innovateuk.ifs.form.resource.FormInputType;
import org.innovateuk.ifs.form.resource.SectionType;
import org.innovateuk.ifs.question.resource.QuestionSetupType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
import org.springframework.validation.BindingResult;
import org.springframework.validation.DataBinder;
import org.springframework.validation.Validator;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import static org.hibernate.validator.internal.util.CollectionHelper.asSet;
import static org.innovateuk.ifs.finance.resource.cost.FinanceRowType.*;
import static org.innovateuk.ifs.form.resource.FormInputScope.APPLICATION;
import static org.innovateuk.ifs.util.CollectionFunctions.simpleFilter;

@Component
public class ApplicationValidationUtil {
    private final static Log LOG = LogFactory.getLog(ApplicationValidationUtil.class);

    @Autowired
    private ApplicationContext context;

    @Autowired
    private ApplicationValidatorService applicationValidatorService;

    @Autowired
    private ApplicationTeamMarkAsCompleteValidator applicationTeamMarkAsCompleteValidator;

    @Autowired
    private ApplicationDetailsMarkAsCompleteValidator applicationDetailsMarkAsCompleteValidator;

    @Autowired
    private ApplicationResearchMarkAsCompleteValidator applicationResearchMarkAsCompleteValidator;

    @Autowired
    private ApplicationDetailsMarkAsCompleteValidator applicationDetailsMarkAsCompleteValidator;

    public BindingResult validateResponse(FormInputResponse response, boolean ignoreEmpty) {
        DataBinder binder = new DataBinder(response);<commit_msg>IFS-6280 - Duplicate autowired removed.<commit_after>package org.innovateuk.ifs.application.validation;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.innovateuk.ifs.application.domain.Application;
import org.innovateuk.ifs.application.domain.FormInputResponse;
import org.innovateuk.ifs.application.validator.ApplicationDetailsMarkAsCompleteValidator;
import org.innovateuk.ifs.application.validator.ApplicationResearchMarkAsCompleteValidator;
import org.innovateuk.ifs.application.validator.ApplicationTeamMarkAsCompleteValidator;
import org.innovateuk.ifs.application.validator.NotEmptyValidator;
import org.innovateuk.ifs.commons.error.ValidationMessages;
import org.innovateuk.ifs.finance.resource.cost.FinanceRowType;
import org.innovateuk.ifs.form.domain.FormInput;
import org.innovateuk.ifs.form.domain.FormValidator;
import org.innovateuk.ifs.form.domain.Question;
import org.innovateuk.ifs.form.domain.Section;
import org.innovateuk.ifs.form.resource.FormInputType;
import org.innovateuk.ifs.form.resource.SectionType;
import org.innovateuk.ifs.question.resource.QuestionSetupType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
import org.springframework.validation.BindingResult;
import org.springframework.validation.DataBinder;
import org.springframework.validation.Validator;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import static org.hibernate.validator.internal.util.CollectionHelper.asSet;
import static org.innovateuk.ifs.finance.resource.cost.FinanceRowType.*;
import static org.innovateuk.ifs.form.resource.FormInputScope.APPLICATION;
import static org.innovateuk.ifs.util.CollectionFunctions.simpleFilter;

@Component
public class ApplicationValidationUtil {
    private final static Log LOG = LogFactory.getLog(ApplicationValidationUtil.class);

    @Autowired
    private ApplicationContext context;

    @Autowired
    private ApplicationValidatorService applicationValidatorService;

    @Autowired
    private ApplicationTeamMarkAsCompleteValidator applicationTeamMarkAsCompleteValidator;

    @Autowired
    private ApplicationDetailsMarkAsCompleteValidator applicationDetailsMarkAsCompleteValidator;

    @Autowired
    private ApplicationResearchMarkAsCompleteValidator applicationResearchMarkAsCompleteValidator;

    public BindingResult validateResponse(FormInputResponse response, boolean ignoreEmpty) {
        DataBinder binder = new DataBinder(response);
{'fraction_non_alphanumeric': 0.07636914913776767, 'fraction_numerical': 0.0007580064430547659, 'mean_word_length': 7.10752688172043, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '686234', 'n_tokens_mistral': 1395, 'n_tokens_neox': 1399, 'n_words': 218}