Buggy code:
public class AsyncWritesFullIndexCreateApp extends ConfigureClient { public static void main ( String [ ] args ) throws IOException , InterruptedException , SecurityException { if ( ( args . length ) != 10 ) { <START_BUG> System . out . println ( ( "Usage:\njava<seq2seq4repair_space>-jar<seq2seq4repair_space>AsyncWritesApp<seq2seq4repair_space><ESHOST_NAME>" + ( "<seq2seq4repair_space><ES_PORTNUM><seq2seq4repair_space><ES_CLUSERNAME><seq2seq4repair_space><indexNamePrefix><seq2seq4repair_space>" + "<type_name><seq2seq4repair_space><logFileName><seq2seq4repair_space><numOfIndexes><seq2seq4repair_space><number_of_documents><seq2seq4repair_space><num_of_fields><seq2seq4repair_space><num_of_replicas>" ) ) ) ; <END_BUG> System . exit ( 0 ) ; } String esHostName = args [ 0 ] ; int esPortNum = Integer . parseInt ( args [ 1 ] ) ; String esClusterName = args [ 2 ] ; String indexNamePrefix = args [ 3 ] ; String typeName = args [ 4 ] ; String logFileName = args [ 5 ] ; int numOfIndexes = Integer . parseInt ( args [ 6 ] ) ; int numOfDocuments = Integer . parseInt ( args [ 7 ] ) ; int numOfFields = Integer . parseInt ( args [ 8 ] ) ; int repId = Integer . parseInt ( args [ 9 ] ) ; Logger log = setupLog ( ( "new5" + logFileName ) , AsyncWritesFullIndexCreateApp . class . getName ( ) ) ; Client client = setupClient ( esClusterName , esHostName , esPortNum ) ; log . info ( "Starting<seq2seq4repair_space>Indexing....." ) ; long startTimeAllIndex = System . currentTimeMillis ( ) ; ArrayList < Long > indexTimeIndexes = new ArrayList < Long > ( ) ; for ( int indexId = 1 ; indexId <= numOfIndexes ; indexId ++ ) { log . info ( ( ( ( ( "\n\nIndex<seq2seq4repair_space>Name:<seq2seq4repair_space>" + indexNamePrefix ) + ( String . valueOf ( indexId ) ) ) + "r" ) + ( String . valueOf ( repId ) ) ) ) ; long startTimeIndivIndex = System . currentTimeMillis ( ) ; for ( int docId = 1 ; docId <= numOfDocuments ; docId ++ ) { long startTimeIndivDoc = System . currentTimeMillis ( ) ; Map < String , Object > jsonObject = new HashMap < String , Object > ( ) ; for ( int i = 1 ; i <= numOfFields ; i ++ ) { jsonObject . put ( RandomStringUtils . randomAlphabetic ( 6 ) , RandomStringUtils . randomAlphanumeric ( 5 ) ) ; } try { if ( docId == 1 ) { client . admin ( ) . indices ( ) . prepareCreate ( ( ( ( indexNamePrefix + ( String . valueOf ( indexId ) ) ) + "r" ) + ( String . valueOf ( repId ) ) ) ) . setSettings ( ImmutableSettings . settingsBuilder ( ) . put ( "number_of_shards" , 5 ) . put ( "number_of_replicas" , repId ) ) . execute ( ) . actionGet ( ) ; Thread . sleep ( 360000 ) ; } @ SuppressWarnings ( "unused" ) ListenableActionFuture < IndexResponse > response = client . prepareIndex ( ( ( ( indexNamePrefix + ( String . valueOf ( indexId ) ) ) + "r" ) + ( String . valueOf ( repId ) ) ) , typeName , String . valueOf ( docId ) ) . setSource ( jsonObject ) . execute ( ) ; Thread . sleep ( 1 ) ; } catch ( NoNodeAvailableException n ) { System . err . println ( ( "<seq2seq4repair_space>No<seq2seq4repair_space>Node<seq2seq4repair_space>Available<seq2seq4repair_space>Exception<seq2seq4repair_space>Raised:" + n ) ) ; Thread . sleep ( 5000 ) ; } catch ( TransportException t ) { System . err . println ( ( "Transport<seq2seq4repair_space>Exception<seq2seq4repair_space>Raised:" + t ) ) ; } long endTimeIndivDoc = System . currentTimeMillis ( ) ; long totalTimeIndivDoc = endTimeIndivDoc - startTimeIndivDoc ; log . info ( ( ( ( ( ( "Total<seq2seq4repair_space>Indexing<seq2seq4repair_space>Time<seq2seq4repair_space>(ms)<seq2seq4repair_space>for<seq2seq4repair_space>index<seq2seq4repair_space>#" + indexId ) + ",<seq2seq4repair_space>document<seq2seq4repair_space>#" ) + docId ) + "<seq2seq4repair_space>:<seq2seq4repair_space>" ) + totalTimeIndivDoc ) ) ; } long endTimeIndivIndex = System . currentTimeMillis ( ) ; long totaltimeIndivIndex = endTimeIndivIndex - startTimeIndivIndex ; indexTimeIndexes . add ( totaltimeIndivIndex ) ; } long endTimeAllIndex = System . currentTimeMillis ( ) ; long totalTimeAllIndex = endTimeAllIndex - startTimeAllIndex ; log . info ( ( "Total<seq2seq4repair_space>Time<seq2seq4repair_space>to<seq2seq4repair_space>index<seq2seq4repair_space>all<seq2seq4repair_space>the<seq2seq4repair_space>documents<seq2seq4repair_space>[Outside<seq2seq4repair_space>Loop]:<seq2seq4repair_space>" + totalTimeAllIndex ) ) ; log . info ( "###<seq2seq4repair_space>INDEX<seq2seq4repair_space>LEVEL<seq2seq4repair_space>###" ) ; long finalSumIndexTime = 0 ; for ( int i = 0 ; i < ( indexTimeIndexes . size ( ) ) ; i ++ ) { log . info ( ( ( ( "Total<seq2seq4repair_space>Indexing<seq2seq4repair_space>Time<seq2seq4repair_space>(ms)<seq2seq4repair_space>for<seq2seq4repair_space>Index#" + ( i + 1 ) ) + "<seq2seq4repair_space>is:<seq2seq4repair_space>" ) + ( indexTimeIndexes . get ( i ) ) ) ) ; finalSumIndexTime += indexTimeIndexes . get ( i ) ; } log . info ( ( "Total<seq2seq4repair_space>time<seq2seq4repair_space>as<seq2seq4repair_space>Sum<seq2seq4repair_space>of<seq2seq4repair_space>Indexing<seq2seq4repair_space>all<seq2seq4repair_space>Indexes:<seq2seq4repair_space>" + finalSumIndexTime ) ) ; Thread . sleep ( 300000 ) ; closeClient ( client ) ; log . info ( "Task<seq2seq4repair_space>Completed!" ) ; } }

Fix:
System . out . println ( ( "Usage:\njava<seq2seq4repair_space>-jar<seq2seq4repair_space>AsyncWritesFullIndexCreateApp<seq2seq4repair_space><ESHOST_NAME>" + ( "<seq2seq4repair_space><ES_PORTNUM><seq2seq4repair_space><ES_CLUSERNAME><seq2seq4repair_space><indexNamePrefix><seq2seq4repair_space>" + "<type_name><seq2seq4repair_space><logFileName><seq2seq4repair_space><numOfIndexes><seq2seq4repair_space><number_of_documents><seq2seq4repair_space><num_of_fields><seq2seq4repair_space><num_of_replicas>" ) ) ) ;