Apache Commons logo Apache Commons JEXL

CPD Results

The following document contains the results of PMD's CPD 5.3.2.

Duplications

File Line
org/apache/commons/jexl3/internal/IntegerRange.java 140
org/apache/commons/jexl3/internal/LongRange.java 142
        if (ct.isAssignableFrom(Integer.class)) {
            if (array.length < length) {
                copy = ct == Object.class
                       ? (T[]) new Object[length]
                       : (T[]) Array.newInstance(ct, length);
            }
            for (int a = 0; a < length; ++a) {
                Array.set(copy, a, min + a);
            }
            if (length < array.length) {
                array[length] = null;
            }
            return copy;
        }
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean containsAll(Collection<?> c) {
        for(Object cc : c) {
            if (!contains(cc)) {
                return false;
            }
        }
        return true;
    }

    @Override
    public boolean add(Integer e) {
File Line
org/apache/commons/jexl3/internal/IntegerRange.java 117
org/apache/commons/jexl3/internal/LongRange.java 119
            long v = ((Number) o).intValue();
            return min <= v && v <= max;
        } else {
            return false;
        }
    }

    @Override
    public Object[] toArray() {
        final int size = size();
        Object[] array = new Object[size];
        for(int a = 0; a < size; ++a) {
            array[a] = min + a;
        }
        return array;
    }

    @Override
    @SuppressWarnings("unchecked")
    public <T> T[] toArray(T[] array) {
        final Class<?> ct = array.getClass().getComponentType();
        final int length = size();
        T[] copy = array;
        if (ct.isAssignableFrom(Integer.class)) {