<commit_before>package com.bina.intervalTree;

import org.apache.log4j.Logger;

import java.util.Random;

/**
 * Simple interval, End-points inclusive, immutable
 *
 * @author johnmu
 */
public class SimpleInterval1D implements Comparable<Interval1D>, Interval1D {
    private final static Logger log = Logger.getLogger(SimpleInterval1D.class.getName());
    public final long left; // left endpoint, inclusive
    public final long right; // right endpoint, inclusive

    /**
     * Require left <= right
     *
     * @param left  Left end-point (inclusive)
     * @param right Right end-point (inclusive)
     */
    public SimpleInterval1D(long left, long right) {
        if ((left <= right) && ((((right / 2) + 1) - ((left / 2) - 1)) < (Long.MAX_VALUE / 2))) {
            this.left = left;
            this.right = right;
        } else {
            throw new RuntimeException("Illegal SimpleInterval1D (negative range or too large range): " + left + "-" + right);
        }
    }

    public SimpleInterval1D(Interval1D reg) {
        if (reg.length() < 0) {
            throw new RuntimeException("Illegal SimpleInterval1D (negative range or too large range): " + reg);<commit_msg>allow 0 length interval (e.g. ref/ref line)<commit_after>package com.bina.intervalTree;

import org.apache.log4j.Logger;

import java.util.Random;

/**
 * Simple interval, End-points inclusive, immutable
 *
 * @author johnmu
 */
public class SimpleInterval1D implements Comparable<Interval1D>, Interval1D {
    private final static Logger log = Logger.getLogger(SimpleInterval1D.class.getName());
    public final long left; // left endpoint, inclusive
    public final long right; // right endpoint, inclusive

    /**
     * Require left <= right
     *
     * @param left  Left end-point (inclusive)
     * @param right Right end-point (inclusive)
     */
    public SimpleInterval1D(long left, long right) {
        if ((left - 1 <= right) && ((((right / 2) + 1) - ((left / 2) - 1)) < (Long.MAX_VALUE / 2))) {
            this.left = left;
            this.right = right;
        } else {
            throw new RuntimeException("Illegal SimpleInterval1D (negative range or too large range): " + left + "-" + right);
        }
    }

    public SimpleInterval1D(Interval1D reg) {
        if (reg.length() < 0) {
            throw new RuntimeException("Illegal SimpleInterval1D (negative range or too large range): " + reg);
{'fraction_non_alphanumeric': 0.12076095947063689, 'fraction_numerical': 0.014061207609594707, 'mean_word_length': 2.727272727272727, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 5, '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': '4261552', 'n_tokens_mistral': 710, 'n_tokens_neox': 688, 'n_words': 210}