<commit_before>package org.navalplanner.business.common.exceptions;

import org.apache.commons.lang.Validate;
import org.hibernate.validator.InvalidValue;

/**
 * Encapsulates some validation failure <br />
 * @author <NAME> <<EMAIL>>
 */
public class ValidationException extends Exception {

    private InvalidValue[] invalidValues;

    public InvalidValue[] getInvalidValues() {
        return invalidValues;
    }

    public ValidationException(InvalidValue[] invalidValues) {
        super();
        Validate.noNullElements(invalidValues);
        this.invalidValues = invalidValues;
    }

    public ValidationException(InvalidValue[] invalidValues, String message,
            Throwable cause) {
        super(message, cause);
        Validate.noNullElements(invalidValues);
        this.invalidValues = invalidValues;
    }

    public ValidationException(InvalidValue[] invalidValues, String message) {
        super(message);
        Validate.noNullElements(invalidValues);
        this.invalidValues = invalidValues;
    }

    public ValidationException(InvalidValue[] invalidValues, Throwable cause) {
        super(cause);
        Validate.noNullElements(invalidValues);
        this.invalidValues = invalidValues;
    }

    public ValidationException(String message) {
        this(new InvalidValue[] {}, message);
    }

}<commit_msg>ItEr23S03ContornaItEr22S03: Doing defensive copy of array parameters<commit_after>package org.navalplanner.business.common.exceptions;

import org.apache.commons.lang.Validate;
import org.hibernate.validator.InvalidValue;

/**
 * Encapsulates some validation failure <br />
 * @author <NAME> <<EMAIL>>
 */
public class ValidationException extends Exception {

    private InvalidValue[] invalidValues;

    public InvalidValue[] getInvalidValues() {
        return invalidValues;
    }

    public ValidationException(InvalidValue[] invalidValues) {
        super();
        storeInvalidValues(invalidValues);
    }

    private void storeInvalidValues(InvalidValue[] invalidValues) {
        Validate.noNullElements(invalidValues);
        this.invalidValues = invalidValues.clone();
    }

    public ValidationException(InvalidValue[] invalidValues, String message,
            Throwable cause) {
        super(message, cause);
        storeInvalidValues(invalidValues);
    }

    public ValidationException(InvalidValue[] invalidValues, String message) {
        super(message);
        storeInvalidValues(invalidValues);
    }

    public ValidationException(InvalidValue[] invalidValues, Throwable cause) {
        super(cause);
        storeInvalidValues(invalidValues);
    }

    public ValidationException(String message) {
        this(new InvalidValue[] {}, message);
    }

}
{'fraction_non_alphanumeric': 0.09293002915451895, 'fraction_numerical': 0.0029154518950437317, 'mean_word_length': 3.56738768718802, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1700558', 'n_tokens_mistral': 702, 'n_tokens_neox': 671, 'n_words': 145}