Buggy code:
public class CassandraImporterTool extends FramesocTool { private static final String KEYSPACE_BASE = "cassandra" ; protected static final int WORK_STEP = 50000 ; private int events = 10 ; private int types = 10 ; private int producers = 10 ; public CassandraImporterTool ( ) { } @ Override public void launch ( final IFramesocToolInput input ) { Job job = new Job ( "Cassandra<seq2seq4repair_space>Importer" ) { @ Override protected IStatus run ( IProgressMonitor monitor ) { SystemDBObject sysDB = null ; CassandraSession session = null ; try { FileInput fileInput = ( ( FileInput ) ( input ) ) ; String path = fileInput . getFiles ( ) . get ( 0 ) ; CassandraImporterConfig conf = new CassandraImporterConfig ( ) ; if ( ! ( conf . load ( path ) ) ) { throw new SoCTraceException ( ( "Error<seq2seq4repair_space>loading<seq2seq4repair_space>configuration<seq2seq4repair_space>file:<seq2seq4repair_space>" + path ) ) ; } events = Integer . valueOf ( conf . get ( EVENTS ) ) ; types = Integer . valueOf ( conf . get ( TYPES ) ) ; producers = Integer . valueOf ( conf . get ( PRODUCERS ) ) ; System . out . println ( ( "Events:<seq2seq4repair_space>" + ( events ) ) ) ; System . out . println ( ( "Types:<seq2seq4repair_space>" + ( types ) ) ) ; System . out . println ( ( "Producers:<seq2seq4repair_space>" + ( producers ) ) ) ; monitor . beginTask ( "Importing<seq2seq4repair_space>fake<seq2seq4repair_space>trace" , ( ( ( events ) + ( producers ) ) + ( types ) ) ) ; String dbName = FramesocManager . getInstance ( ) . getTraceDBName ( CassandraImporterTool . KEYSPACE_BASE ) ; DeltaManager dm = new DeltaManager ( ) ; <START_BUG> sysDB = SystemDBObject . openNewIstance ( ) ; <END_BUG> CassandraTraceMetadata meta = new CassandraTraceMetadata ( sysDB , dbName , 0 , ( ( events ) * 10 ) , events ) ; Trace t = new Trace ( sysDB . getNewId ( TRACE . toString ( ) , "ID" ) ) ; meta . setTraceFields ( t ) ; meta . createMetadata ( ) ; meta . saveMetadata ( ) ; dm . start ( ) ; session = new CassandraSession ( dbName , DBMode . DB_CREATE ) ; dm . end ( "schema" ) ; dm . start ( ) ; for ( int i = 0 ; i < ( producers ) ; i ++ ) { StringBuilder sb = new StringBuilder ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>EVENT_PRODUCER<seq2seq4repair_space>(ID,<seq2seq4repair_space>NAME)<seq2seq4repair_space>VALUES<seq2seq4repair_space>" ) ; sb . append ( "(" ) ; sb . append ( ( i + ",<seq2seq4repair_space>" ) ) ; sb . append ( ( ( "'producer_" + i ) + "'" ) ) ; sb . append ( ");" ) ; session . execute ( sb . toString ( ) ) ; } monitor . worked ( producers ) ; dm . end ( "producers" ) ; dm . start ( ) ; for ( int i = 0 ; i < ( types ) ; i ++ ) { StringBuilder sb = new StringBuilder ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>EVENT_TYPE<seq2seq4repair_space>(ID,<seq2seq4repair_space>NAME)<seq2seq4repair_space>VALUES<seq2seq4repair_space>" ) ; sb . append ( "(" ) ; sb . append ( ( i + ",<seq2seq4repair_space>" ) ) ; sb . append ( ( ( "'type" + i ) + "'" ) ) ; sb . append ( ");" ) ; session . execute ( sb . toString ( ) ) ; } monitor . worked ( types ) ; dm . end ( "types" ) ; dm . start ( ) ; PreparedStatement statement = session . prepare ( ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>EVENT<seq2seq4repair_space>(ID,<seq2seq4repair_space>CPU,<seq2seq4repair_space>EVENT_TYPE_ID,<seq2seq4repair_space>EVENT_PRODUCER_ID," + ( "<seq2seq4repair_space>CATEGORY,<seq2seq4repair_space>TIMESTAMP,<seq2seq4repair_space>LPAR,<seq2seq4repair_space>DPAR)<seq2seq4repair_space>VALUES<seq2seq4repair_space>(?,<seq2seq4repair_space>?<seq2seq4repair_space>,<seq2seq4repair_space>?<seq2seq4repair_space>,<seq2seq4repair_space>?<seq2seq4repair_space>,<seq2seq4repair_space>?<seq2seq4repair_space>," + "<seq2seq4repair_space>?<seq2seq4repair_space>,<seq2seq4repair_space>?<seq2seq4repair_space>,<seq2seq4repair_space>?)" ) ) ) ; List < ResultSetFuture > futures = new ArrayList < > ( ) ; IdManager idm = new IdManager ( ) ; for ( int i = 0 ; i < ( events ) ; i ++ ) { BoundStatement bind = statement . bind ( idm . getNextId ( ) , 0 , ( ( Double ) ( ( Math . random ( ) ) * ( types ) ) ) . intValue ( ) , ( ( Double ) ( ( Math . random ( ) ) * ( producers ) ) ) . intValue ( ) , STATE , ( 10L * i ) , ( ( 10L * i ) + 9L ) , 0.0 ) ; ResultSetFuture resultSetFuture = session . executeAsync ( bind ) ; futures . add ( resultSetFuture ) ; if ( ( i % ( CassandraImporterTool . WORK_STEP ) ) == 0 ) { System . out . println ( i ) ; monitor . worked ( CassandraImporterTool . WORK_STEP ) ; } } dm . end ( "End<seq2seq4repair_space>import" ) ; } catch ( SoCTraceException e ) { e . printStackTrace ( ) ; return Status . CANCEL_STATUS ; } finally { DBObject . finalClose ( sysDB ) ; CassandraSession . finalClose ( session ) ; } return Status . OK_STATUS ; } } ; job . setUser ( true ) ; job . schedule ( ) ; } @ Override public ParameterCheckStatus canLaunch ( IFramesocToolInput input ) { } }

Fix:
sysDB = SystemDBObject . openNewInstance ( ) ;