<commit_before>package org.jlib.container.sequence.index;


/*
 * jlib - The Free Java Library
 *
 *    http://www.jlib.org
 *
 * Copyright (c) 2006-2008 <NAME>
 *
 * jlib is distributed under the
 *
 *    COMMON PUBLIC LICENSE VERSION 1.0
 *
 *    http://www.opensource.org/licenses/cpl1.0.php
 */

/**
 * Exception thrown when a {@link IndexSequence} is accessed with an invalid
 * index.
 * 
 * @author <NAME>
 */
public class SequenceIndexOutOfBoundsException
extends IndexOutOfBoundsException {

    /** serialVersionUID */
    private static final long serialVersionUID = 1501618255867836784L;

    /** {@link IndexSequence} accessed with the invalid index */
    private final IndexSequence<?> sequence;

    /** invalid index */
    private final int invalidIndex;

    /**
     * Creates a new SequenceIndexOutOfBoundsException for the specified invalid
     * invalidIndex and the specified message.
     * 
     * @param sequence
     *        {@link IndexSequence} accessed with the invalid index
     * 
     * @param invalidIndex
     *        integer specifying the invalid invalidIndex
     * 
     * @param message
     *        String specifying the message explaining the invalid access
     */
    public SequenceIndexOutOfBoundsException(final IndexSequence<?> sequence, final int invalidIndex,
                                             final String message) {
        super(message + "[" + invalidIndex + "]");

        this.sequence = sequence;
        this.invalidIndex = invalidIndex;
    }

    /**
     * Returns the invalid invalidIndex of this
     * SequenceIndexOutOfBoundsException.
     * 
     * @return integer specifying the invalid invalidIndex
     */
    public int getInvalidIndex() {
        return invalidIndex;
    }

    /**
     * Returns the {@link IndexSequence} accessed with the invalid index
     * 
     * @return {@link IndexSequence} accessed with the invalid index
     */
    public IndexSequence<?> getSequence() {
        return sequence;
    }
}<commit_msg>SequenceIndexOutOfBoundsException: message handling optimized<commit_after>package org.jlib.container.sequence.index;

import org.jlib.container.sequence.IllegalSequenceArgumentException;

/*
 * jlib - The Free Java Library
 *
 *    http://www.jlib.org
 *
 * Copyright (c) 2006-2008 <NAME>
 *
 * jlib is distributed under the
 *
 *    COMMON PUBLIC LICENSE VERSION 1.0
 *
 *    http://www.opensource.org/licenses/cpl1.0.php
 */

/**
 * {@link IllegalSequenceArgumentException} thrown when a {@link IndexSequence}
 * is accessed with an invalid index.
 * 
 * @author <NAME>
 */
public class SequenceIndexOutOfBoundsException
extends IllegalSequenceArgumentException {

    /** serialVersionUID */
    private static final long serialVersionUID = 1501618255867836784L;

    /** invalid index */
    private final int invalidIndex;

    /**
     * Creates a new SequenceIndexOutOfBoundsException for the specified invalid
     * invalidIndex and the specified message.
     * 
     * @param sequence
     *        {@link IndexSequence} accessed with the invalid index
     * 
     * @param invalidIndex
     *        integer specifying the invalid invalidIndex
     * 
     * @param message
     *        {@link String} specifying the message explaining the invalid
     *        access
     */
    public SequenceIndexOutOfBoundsException(final IndexSequence<?> sequence, final int invalidIndex,
                                             final String message) {
        super(sequence, "{1}: {3}[{2}]", invalidIndex, message);

        this.invalidIndex = invalidIndex;
    }

    /**
     * Returns the invalid index of this SequenceIndexOutOfBoundsException.
     * 
     * @return integer specifying the invalid index
     */
    public int getInvalidIndex() {
        return invalidIndex;
    }
}
{'fraction_non_alphanumeric': 0.08667190363969625, 'fraction_numerical': 0.01702016234616392, 'mean_word_length': 2.5834896810506565, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2898648', 'n_tokens_mistral': 1036, 'n_tokens_neox': 957, 'n_words': 297}