Buggy code:
public static synchronized void loadNewSSTables ( String ksName , String cfName ) { } public synchronized void loadNewSSTables ( ) { } public String getColumnFamilyName ( ) { } public String getFlushPath ( long estimatedSize , String version ) { } public String getTempSSTablePath ( String directory , String version ) { } public String getTempSSTablePath ( String directory ) { } public Future < ? > maybeSwitchMemtable ( Memtable oldMemtable , final boolean writeCommitLog ) { } public boolean isDropped ( ) { } public Future < ? > forceFlush ( ) { } public void forceBlockingFlush ( ) throws InterruptedException , ExecutionException { } public void updateRowCache ( DecoratedKey key , ColumnFamily columnFamily ) { } public Memtable apply ( DecoratedKey key , ColumnFamily columnFamily ) { } public static ColumnFamily removeDeletedCF ( ColumnFamily cf , int gcBefore ) { } public static ColumnFamily removeDeleted ( ColumnFamily cf , int gcBefore ) { } public static void removeDeletedColumnsOnly ( ColumnFamily cf , int gcBefore ) { } private static void removeDeletedStandard ( ColumnFamily cf , int gcBefore ) { } private static void removeDeletedSuper ( ColumnFamily cf , int gcBefore ) { } public boolean isKeyInRemainingSSTables ( DecoratedKey key , Set < ? extends SSTable > sstablesToIgnore ) { } public void addSSTable ( SSTableReader sstable ) { } public long getExpectedCompactedFileSize ( Iterable < SSTableReader > sstables ) { } public SSTableReader getMaxSizeFile ( Iterable < SSTableReader > sstables ) { } public void forceCleanup ( NodeId . OneShotRenewer renewer ) throws InterruptedException , ExecutionException { } public void scrub ( ) throws InterruptedException , ExecutionException { } public void markCompacted ( Collection < SSTableReader > sstables ) { } public boolean isCompleteSSTables ( Set < SSTableReader > sstables ) { } public void replaceCompactedSSTables ( Collection < SSTableReader > sstables , Iterable < SSTableReader > replacements ) { } void replaceFlushed ( Memtable memtable , SSTableReader sstable ) { } public boolean isInvalid ( ) { } public void removeAllSSTables ( ) { } public long getMemtableColumnsCount ( ) { } public long getMemtableDataSize ( ) { } public long getTotalMemtableLiveSize ( ) { } public int getMemtableSwitchCount ( ) { } private Memtable getMemtableThreadSafe ( ) { } public DataTracker getDataTracker ( ) { } public Collection < SSTableReader > getSSTables ( ) { } public long [ ] getRecentSSTablesPerReadHistogram ( ) { } public long [ ] getSSTablesPerReadHistogram ( ) { } public long getReadCount ( ) { } public double getRecentReadLatencyMicros ( ) { } public long [ ] getLifetimeReadLatencyHistogramMicros ( ) { } public long [ ] getRecentReadLatencyHistogramMicros ( ) { } public long getTotalReadLatencyMicros ( ) { } public int getPendingTasks ( ) { } public long getWriteCount ( ) { } public long getTotalWriteLatencyMicros ( ) { } public double getRecentWriteLatencyMicros ( ) { } public long [ ] getLifetimeWriteLatencyHistogramMicros ( ) { } public long [ ] getRecentWriteLatencyHistogramMicros ( ) { } public ColumnFamily getColumnFamily ( DecoratedKey key , QueryPath path , ByteBuffer start , ByteBuffer finish , boolean reversed , int limit ) { } public ColumnFamily getColumnFamily ( QueryFilter filter ) { } public ColumnFamily getColumnFamily ( QueryFilter filter , ISortedColumns . Factory factory ) { } public int gcBefore ( ) { } private ColumnFamily cacheRow ( DecoratedKey key ) { } private ColumnFamily getColumnFamily ( QueryFilter filter , int gcBefore , ISortedColumns . Factory factory ) { } ColumnFamily filterColumnFamily ( ColumnFamily cached , QueryFilter filter , int gcBefore ) { } private View markCurrentViewReferenced ( ) { } public Collection < SSTableReader > markCurrentSSTablesReferenced ( ) { } public ColumnFamilyStore . ViewFragment markReferenced ( DecoratedKey key ) { } public ColumnFamilyStore . ViewFragment markReferenced ( DecoratedKey startWith , DecoratedKey stopAt ) { DataTracker . View view ; List < SSTableReader > sstables ; while ( true ) { view = data . getView ( ) ; <START_BUG> Comparable stopInTree = ( stopAt . isEmpty ( ) ) ? view . intervalTree . max : stopAt ; <END_BUG> sstables = view . intervalTree . search ( new org . apache . cassandra . utils . IntervalTree . Interval ( startWith , stopInTree ) ) ; if ( SSTableReader . acquireReferences ( sstables ) ) break ; } return new ColumnFamilyStore . ViewFragment ( sstables , Iterables . concat ( Collections . singleton ( view . memtable ) , view . memtablesPendingFlush ) ) ; } private ColumnFamily getTopLevelColumns ( QueryFilter filter , int gcBefore , ISortedColumns . Factory factory ) { } public List < Row > getRangeSlice ( ByteBuffer superColumn , final AbstractBounds range , int maxResults , IFilter columnFilter ) throws InterruptedException , ExecutionException { } public List < Row > search ( IndexClause clause , AbstractBounds range , IFilter dataFilter ) { } public AbstractType getComparator ( ) { } private void snapshotWithoutFlush ( String snapshotName ) { } public void snapshot ( String snapshotName ) { } public boolean hasUnreclaimedSpace ( ) { } public long getTotalDiskSpaceUsed ( ) { } public long getLiveDiskSpaceUsed ( ) { } public int getLiveSSTableCount ( ) { } public ColumnFamily getRawCachedRow ( DecoratedKey key ) { } public void invalidateCachedRow ( DecoratedKey key ) { } public void forceMajorCompaction ( ) throws InterruptedException , ExecutionException { } public void invalidateRowCache ( ) { } public void invalidateKeyCache ( ) { } public int getRowCacheCapacity ( ) { } public int getKeyCacheCapacity ( ) { } public int getRowCacheSize ( ) { } public int getKeyCacheSize ( ) { } public static Iterable < ColumnFamilyStore > all ( ) { } public Iterable < DecoratedKey > allKeySamples ( ) { } public Iterable < DecoratedKey > keySamples ( Range range ) { } void clearUnsafe ( ) { } private void waitForActiveFlushes ( ) { } public Future < ? > truncate ( ) throws IOException { } public void renameSSTables ( String newCfName ) throws IOException { }

Fix:
Comparable stopInTree = ( stopAt . isEmpty ( ) ) ? view . intervalTree . max ( ) : stopAt ;