Buggy code:
class IntsImpl { private static final String CODEC_NAME = "Ints" ; private static final byte PACKED = 0 ; private static final byte FIXED = 1 ; static final int VERSION_START = 0 ; static final int VERSION_CURRENT = IntsImpl . VERSION_START ; static class IntsWriter extends Writer { private LongsRef intsRef ; private long [ ] docToValue ; private long minValue ; private long maxValue ; private boolean started ; private final String id ; private int lastDocId = - 1 ; private IndexOutput datOut ; protected IntsWriter ( Directory dir , String id , AtomicLong bytesUsed ) throws IOException { } @ Override public void add ( int docID , long v ) throws IOException { } @ Override public void finish ( int docCount ) throws IOException { try { if ( ! ( started ) ) { minValue = maxValue = 0 ; } <START_BUG> if ( ( ( ( maxValue ) - ( minValue ) ) < ( ( ( long ) ( 1 ) ) << 63 ) ) && ( ( ( maxValue ) - ( minValue ) ) > 0 ) ) { <END_BUG> writePackedInts ( docCount ) ; } else { writeFixedInts ( docCount ) ; } } finally { datOut . close ( ) ; bytesUsed . addAndGet ( ( - ( ( RamUsageEstimator . NUM_BYTES_LONG ) * ( docToValue . length ) ) ) ) ; docToValue = null ; } } private void writeFixedInts ( int docCount ) throws IOException { } private void writePackedInts ( int docCount ) throws IOException { } @ Override protected void add ( int docID ) throws IOException { } @ Override protected void setNextEnum ( ValuesEnum valuesEnum ) { } @ Override public void add ( int docID , PerDocFieldValues docValues ) throws IOException { } @ Override public void files ( Collection < String > files ) throws IOException { } } static class IntsReader extends IndexDocValues { private final IndexInput datIn ; private final boolean packed ; protected IntsReader ( Directory dir , String id ) throws IOException { } @ Override public Source load ( ) throws IOException { } private static class FixedIntsSource extends Source { private final long [ ] values ; public FixedIntsSource ( IndexInput dataIn ) throws IOException { } @ Override public long getInt ( int docID ) { } @ Override public ValueType type ( ) { } @ Override public ValuesEnum getEnum ( AttributeSource attrSource ) throws IOException { } } private static class PackedIntsSource extends Source { private final long minValue ; private final long defaultValue ; private final Reader values ; public PackedIntsSource ( IndexInput dataIn ) throws IOException { } @ Override public long getInt ( int docID ) { } @ Override public ValuesEnum getEnum ( AttributeSource attrSource ) throws IOException { } @ Override public ValueType type ( ) { } } @ Override public void close ( ) throws IOException { } @ Override public ValuesEnum getEnum ( AttributeSource source ) throws IOException { } @ Override public ValueType type ( ) { } } private static final class PackedIntsEnumImpl extends ValuesEnum { private final ReaderIterator ints ; private long minValue ; private final IndexInput dataIn ; private final long defaultValue ; private final int maxDoc ; private int pos = - 1 ; private PackedIntsEnumImpl ( AttributeSource source , IndexInput dataIn ) throws IOException { } @ Override public void close ( ) throws IOException { } @ Override public int advance ( int target ) throws IOException { } @ Override public int docID ( ) { } @ Override public int nextDoc ( ) throws IOException { } } private static final class FixedIntsEnumImpl extends ValuesEnum { private final IndexInput dataIn ; private final int maxDoc ; private int pos = - 1 ; private FixedIntsEnumImpl ( AttributeSource source , IndexInput dataIn ) throws IOException { } @ Override public void close ( ) throws IOException { } @ Override public int advance ( int target ) throws IOException { } @ Override public int docID ( ) { } @ Override public int nextDoc ( ) throws IOException { } } }

Fix:
if ( ( ( ( maxValue ) - ( minValue ) ) < ( ( ( long ) ( 1 ) ) << 63 ) ) && ( ( ( maxValue ) - ( minValue ) ) >= 0 ) ) {