Buggy code:
public class ColumnFamilyStore implements ColumnFamilyStoreMBean { private static Logger logger = LoggerFactory . getLogger ( ColumnFamilyStore . class ) ; private static final ScheduledThreadPoolExecutor cacheSavingExecutor = new RetryingScheduledThreadPoolExecutor ( "CACHE-SAVER" , Thread . MIN_PRIORITY ) ; private static final ExecutorService flushSorter = new JMXEnabledThreadPoolExecutor ( 1 , Runtime . getRuntime ( ) . availableProcessors ( ) , StageManager . KEEPALIVE , TimeUnit . SECONDS , new LinkedBlockingQueue < Runnable > ( Runtime . getRuntime ( ) . availableProcessors ( ) ) , new NamedThreadFactory ( "FlushSorter" ) , "internal" ) ; private static final ExecutorService flushWriter = new JMXEnabledThreadPoolExecutor ( 1 , DatabaseDescriptor . getFlushWriters ( ) , StageManager . KEEPALIVE , TimeUnit . SECONDS , new LinkedBlockingQueue < Runnable > ( DatabaseDescriptor . getFlushWriters ( ) ) , new NamedThreadFactory ( "FlushWriter" ) , "internal" ) ; public static final ExecutorService postFlushExecutor = new JMXEnabledThreadPoolExecutor ( "MemtablePostFlusher" ) ; private Set < Memtable > memtablesPendingFlush = new ConcurrentSkipListSet < Memtable > ( ) ; public final Table table ; public final String columnFamily ; public final IPartitioner partitioner ; private final String mbeanName ; private boolean invalid = false ; private volatile int memtableSwitchCount = 0 ; private AtomicInteger fileIndexGenerator = new AtomicInteger ( 0 ) ; private Memtable memtable ; private final ConcurrentSkipListMap < ByteBuffer , ColumnFamilyStore > indexedColumns ; private AtomicReference < BinaryMemtable > binaryMemtable ; private SSTableTracker ssTables ; private LatencyTracker readStats = new LatencyTracker ( ) ; private LatencyTracker writeStats = new LatencyTracker ( ) ; private final EstimatedHistogram recentSSTablesPerRead = new EstimatedHistogram ( 35 ) ; private final EstimatedHistogram sstablesPerRead = new EstimatedHistogram ( 35 ) ; public final CFMetaData metadata ; private volatile DefaultInteger minCompactionThreshold ; private volatile DefaultInteger maxCompactionThreshold ; private volatile DefaultInteger memtime ; private volatile DefaultInteger memsize ; private volatile DefaultDouble memops ; private final Runnable rowCacheSaverTask = new WrappedRunnable ( ) { protected void runMayThrow ( ) throws IOException { } } ; private final Runnable keyCacheSaverTask = new WrappedRunnable ( ) { protected void runMayThrow ( ) throws Exception { } } ; public void reload ( ) { } private ColumnFamilyStore ( Table table , String columnFamilyName , IPartitioner partitioner , int generation , CFMetaData metadata ) { } protected Set < DecoratedKey > readSavedCache ( File path ) { } public void addIndex ( final ColumnDefinition info ) { } public void buildSecondaryIndexes ( Collection < SSTableReader > sstables , SortedSet < ByteBuffer > columns ) { } void unregisterMBean ( ) { } public long getMinRowSize ( ) { } public long getMaxRowSize ( ) { } public long getMeanRowSize ( ) { } public int getMeanColumns ( ) { } public static ColumnFamilyStore createColumnFamilyStore ( Table table , String columnFamily ) { } public static synchronized ColumnFamilyStore createColumnFamilyStore ( Table table , String columnFamily , IPartitioner partitioner , CFMetaData metadata ) { } public static void scrubDataDirectories ( String table , String columnFamily ) { } public void initRowCache ( ) { } public Future < ? > submitRowCacheWrite ( ) { } public Future < ? > submitKeyCacheWrite ( ) { } private static Map < Descriptor , Set < Component > > files ( String keyspace , final String columnFamily , final boolean includeCompacted ) { } public String getColumnFamilyName ( ) { } public String getFlushPath ( ) { <START_BUG> long guessedSize = ( ( 2 * ( memsize . value ( ) ) ) * 1024 ) * 1024 ; <END_BUG> String location = DatabaseDescriptor . getDataFileLocationForTable ( table . name , guessedSize ) ; if ( location == null ) throw new RuntimeException ( "Insufficient<seq2seq4repair_space>disk<seq2seq4repair_space>space<seq2seq4repair_space>to<seq2seq4repair_space>flush" ) ; return getTempSSTablePath ( location ) ; } public String getTempSSTablePath ( String directory ) { } Future < ? > maybeSwitchMemtable ( Memtable oldMemtable , final boolean writeCommitLog ) { } void switchBinaryMemtable ( DecoratedKey key , ByteBuffer buffer ) { } public void forceFlushIfExpired ( ) { } public Future < ? > forceFlush ( ) { } public void forceBlockingFlush ( ) throws InterruptedException , ExecutionException { } public void forceFlushBinary ( ) { } Memtable apply ( DecoratedKey key , ColumnFamily columnFamily ) { } void applyBinary ( DecoratedKey key , ByteBuffer buffer ) { } public static ColumnFamily removeDeletedCF ( ColumnFamily cf , int gcBefore ) { } public static ColumnFamily removeDeleted ( ColumnFamily cf , int gcBefore ) { } private 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 < SSTable > sstablesToIgnore ) { } public void addSSTable ( SSTableReader sstable ) { } long getExpectedCompactedFileSize ( Iterable < SSTableReader > sstables ) { } SSTableReader getMaxSizeFile ( Iterable < SSTableReader > sstables ) { } void forceCleanup ( ) throws InterruptedException , ExecutionException { } void markCompacted ( Collection < SSTableReader > sstables ) { } boolean isCompleteSSTables ( Collection < SSTableReader > sstables ) { } void replaceCompactedSSTables ( Collection < SSTableReader > sstables , Iterable < SSTableReader > replacements ) { } public boolean isInvalid ( ) { } public void removeAllSSTables ( ) { } void submitFlush ( IFlushable flushable , CountDownLatch latch ) { } public int getMemtableColumnsCount ( ) { } public int getMemtableDataSize ( ) { } public int getMemtableSwitchCount ( ) { } private Memtable getMemtableThreadSafe ( ) { } 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 ( ) { }

Fix:
long guessedSize = ( ( 2L * ( memsize . value ( ) ) ) * 1024 ) * 1024 ;