<commit_before>package org.innovateuk.ifs.competitionsetup.form.application;

import org.innovateuk.ifs.commons.validation.constraints.FieldComparison;
import org.innovateuk.ifs.commons.validation.predicate.BiPredicateProvider;
import org.innovateuk.ifs.competitionsetup.form.CompetitionSetupForm;

import javax.validation.constraints.NotNull;
import java.util.function.BiPredicate;

@FieldComparison(
        firstField = "maxProjectDuration",
        secondField = "minProjectDuration",
        message = "{competition.setup.applicationdetails.max.projectduration.beneathmin}",
        predicate = ApplicationDetailsForm.MaxBeneathMinPredicateProvider.class)
@FieldComparison(
        firstField = "minProjectDuration",
        secondField = "maxProjectDuration",
        message = "{competition.setup.applicationdetails.min.projectduration.exceedsmax}",
        predicate = ApplicationDetailsForm.MinExceedsMaxPredicateProvider.class)
public class ApplicationDetailsForm extends CompetitionSetupForm {

    @NotNull
    private Integer minProjectDuration;

    @NotNull
    private Integer maxProjectDuration;

    private boolean useResubmissionQuestion;

    public Integer getMinProjectDuration() {
        return minProjectDuration;
    }<commit_msg>IFS-2776 - Fixed issue where it couldn't find the error message if the field submitted empty<commit_after>package org.innovateuk.ifs.competitionsetup.form.application;

import org.hibernate.validator.constraints.NotEmpty;
import org.innovateuk.ifs.commons.validation.constraints.FieldComparison;
import org.innovateuk.ifs.commons.validation.predicate.BiPredicateProvider;
import org.innovateuk.ifs.competitionsetup.form.CompetitionSetupForm;

import java.util.function.BiPredicate;

@FieldComparison(
        firstField = "maxProjectDuration",
        secondField = "minProjectDuration",
        message = "{competition.setup.applicationdetails.max.projectduration.beneathmin}",
        predicate = ApplicationDetailsForm.MaxBeneathMinPredicateProvider.class)
@FieldComparison(
        firstField = "minProjectDuration",
        secondField = "maxProjectDuration",
        message = "{competition.setup.applicationdetails.min.projectduration.exceedsmax}",
        predicate = ApplicationDetailsForm.MinExceedsMaxPredicateProvider.class)
public class ApplicationDetailsForm extends CompetitionSetupForm {

    @NotEmpty(message="{validation.field.must.not.be.blank}")
    private Integer minProjectDuration;

    @NotEmpty(message="{validation.field.must.not.be.blank}")
    private Integer maxProjectDuration;

    private boolean useResubmissionQuestion;

    public Integer getMinProjectDuration() {
        return minProjectDuration;
    }
{'fraction_non_alphanumeric': 0.08299370137087811, 'fraction_numerical': 0.0014820303816228233, 'mean_word_length': 5.013363028953229, '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': '1925629', 'n_tokens_mistral': 714, 'n_tokens_neox': 691, 'n_words': 116}