Buggy code:
if ( serverHost . equals ( "localhost" ) ) { serverClassPath = classPath ; } String command = "start" ; String securityOption = "" ; securityOption = "-noSecurityManager" ; String workingDirName = ( ( ReplicationRun . masterDatabasePath ) + ( ReplicationRun . FS ) ) + ( ReplicationRun . masterDbSubPath ) ; final String [ ] commandElements = new String [ ] { ReplicationRun . getMasterJavaExecutableName ( ) , "<seq2seq4repair_space>-Dderby.system.home=" + workingDirName , "<seq2seq4repair_space>-Dderby.infolog.append=true" , "<seq2seq4repair_space>-cp<seq2seq4repair_space>" , serverClassPath , "<seq2seq4repair_space>" + ( ReplicationRun . networkServerControl ) , "<seq2seq4repair_space>" + command , "<seq2seq4repair_space>-h<seq2seq4repair_space>" , interfacesToListenOn , "<seq2seq4repair_space>-p<seq2seq4repair_space>" , serverPort + "" , "<seq2seq4repair_space>" + securityOption } ; String [ ] envElements = new String [ ] { "CLASS_PATH=" + serverClassPath , ( ( ( ( "PATH=" + serverVM ) + ( ReplicationRun . FS ) ) + ".." ) + ( ReplicationRun . FS ) ) + "bin" } ; if ( serverHost . equals ( "localhost" ) ) { envElements = null ; } String tmp = "" ; for ( int i = 0 ; i < ( commandElements . length ) ; i ++ ) { tmp = tmp + ( commandElements [ i ] ) ; } util . DEBUG ( ( ( debugId + "commandElements:<seq2seq4repair_space>" ) + tmp ) ) ; final String fullCmd = tmp ; tmp = "" ; if ( envElements != null ) { for ( int i = 0 ; i < ( envElements . length ) ; i ++ ) { tmp = ( tmp + ( envElements [ i ] ) ) + "<seq2seq4repair_space>" ; } } util . DEBUG ( ( ( debugId + "envElements:<seq2seq4repair_space>" ) + tmp ) ) ; if ( ( serverHost . equalsIgnoreCase ( "localhost" ) ) || ( ReplicationRun . localEnv ) ) { } String shellCmd = null ; if ( serverHost . equalsIgnoreCase ( "localhost" ) ) { util . DEBUG ( ( ( debugId + "Starting<seq2seq4repair_space>server<seq2seq4repair_space>on<seq2seq4repair_space>localhost<seq2seq4repair_space>" ) + serverHost ) ) ; shellCmd = fullCmd ; } else { util . DEBUG ( ( ( debugId + "Starting<seq2seq4repair_space>server<seq2seq4repair_space>on<seq2seq4repair_space>non-local<seq2seq4repair_space>host<seq2seq4repair_space>" ) + serverHost ) ) ; String [ ] shEnvElements = new String [ ] { "CLASS_PATH=" + serverClassPath , ( ( ( ( "PATH=" + serverVM ) + ( ReplicationRun . FS ) ) + ".." ) + ( ReplicationRun . FS ) ) + "bin:${PATH}" } ; String shellEnv = "" ; for ( int i = 0 ; i < ( shEnvElements . length ) ; i ++ ) { shellEnv = ( shellEnv + ( shEnvElements [ i ] ) ) + ";" ; } util . DEBUG ( ( ( debugId + "shellEnv:<seq2seq4repair_space>" ) + shellEnv ) ) ; shellCmd = ( ( ( "cd<seq2seq4repair_space>" + workingDirName ) + ";pwd;" ) + shellEnv ) + fullCmd ; util . DEBUG ( ( ( debugId + "shellCmd:<seq2seq4repair_space>" ) + shellCmd ) ) ; shellCmd = ( ( ( ( ( ( ( ReplicationRun . remoteShell ) + "<seq2seq4repair_space>" ) + "-l<seq2seq4repair_space>" ) + ( ReplicationRun . testUser ) ) + "<seq2seq4repair_space>-n<seq2seq4repair_space>" ) + serverHost ) + "<seq2seq4repair_space>" ) + shellCmd ; } { final String localCommand = shellCmd ; util . DEBUG ( ( ( debugId + "localCommand:<seq2seq4repair_space>" ) + localCommand ) ) ; final String [ ] fEnvElements = envElements ; Thread serverThread = new Thread ( new Runnable ( ) { public void run ( ) { Process proc = null ; try { util . DEBUG ( ( debugId + "**************<seq2seq4repair_space>In<seq2seq4repair_space>run()." ) ) ; proc = Runtime . getRuntime ( ) . exec ( localCommand , fEnvElements , null ) ; util . DEBUG ( ( debugId + "**************<seq2seq4repair_space>Done<seq2seq4repair_space>exec()." ) ) ; processDEBUGOutput ( ( debugId + "pDo<seq2seq4repair_space>" ) , proc ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } } ) ; String userStartTimeout = getSystemProperty ( "derby.tests.networkServerStartTimeout" ) ; <START_BUG> long startTimeout = ( userStartTimeout != null ) ? Long . parseLong ( userStartTimeout ) : ReplicationRun . DEFAULT_SERVER_START_TIMEOUT ; <END_BUG> long iterations = startTimeout // ( ReplicationRun . PINGSERVER_SLEEP_TIME_MILLIS ) ; util . DEBUG ( ( debugId + "**************<seq2seq4repair_space>Do<seq2seq4repair_space>.start()." ) ) ; serverThread . start ( ) ; pingServer ( serverHost , serverPort , ( ( int ) ( iterations ) ) ) ; } util . DEBUG ( ( debugId + "---<seq2seq4repair_space>StartServer<seq2seq4repair_space>" ) ) ; util . DEBUG ( "" ) ; return null ; } void killMaster ( String masterServerHost , int masterServerPort ) throws InterruptedException { } void killSlave ( String slaveServerHost , int slaveServerPort ) throws InterruptedException { } void destroySlaveDB ( String slaveServerHost ) throws InterruptedException { } void stopServer ( String serverVM , String serverVersion , String serverHost , int serverPort ) { } private String processOutput ( Process proc ) throws Exception { } private String processOutput ( String id , Process proc ) throws Exception { } private void processDEBUGOutput ( String id , Process proc ) throws Exception { } private void pingServer ( String hostName , int port , int iterations ) throws Exception { } private void ping ( NetworkServerControl controller , int iterations ) throws Exception { } void startOptionalLoad ( ReplicationRun . Load load , String dbSubPath , String serverHost , int serverPort ) throws Exception { } void startLoad ( String load , String dbSubPath , String database , boolean existingDB , String testClientHost , String serverHost , int serverPort ) throws Exception { } void makeReadyForReplication ( ) throws Exception { } void cleanAllTestHosts ( ) { } class State { String testPreStartedMasterServer = null ; boolean testPreStartedMasterServerReturn = false ; String testPreStartedSlaveServer = null ; boolean testPreStartedSlaveServerReturn = false ; String testPreStartedMaster = null ; boolean testPreStartedMasterReturn = false ; String testPreInitSlave = null ; boolean testPreInitSlaveReturn = false ;

Fix:
long startTimeout = ( userStartTimeout != null ) ? ( Long . parseLong ( userStartTimeout ) ) * 1000 : ReplicationRun . DEFAULT_SERVER_START_TIMEOUT ;