Buggy code:
public class CheckNewJobs extends TimerTask { private static Log log = LogFactory . getLog ( CheckNewJobs . class ) ; public int aantalConcurrentJobs = 4 ; ArrayList < WAD_ProcessThread > processList = new ArrayList < WAD_ProcessThread > ( ) ; int processID = 0 ; public int teller = 0 ; public void run ( ) { CheckNewJobs . log . info ( "Begin<seq2seq4repair_space>cyclus<seq2seq4repair_space>processor." ) ; ( teller ) ++ ; DatabaseParameters iqcDBParams = new DatabaseParameters ( ) ; iqcDBParams = ReadConfigXML . ReadIqcDBParameters ( iqcDBParams ) ; Connection dbConnection = PacsDatabaseConnection . conDb ( iqcDBParams ) ; Iterator < WAD_ProcessThread > i = null ; WAD_ProcessThread rp = null ; for ( i = processList . iterator ( ) ; i . hasNext ( ) ; ) { teller = 0 ; rp = i . next ( ) ; if ( ! ( rp . isRunning ( ) ) ) { CheckNewJobs . log . info ( ( ( "Thread<seq2seq4repair_space>" + ( rp . ID ( ) ) ) + "<seq2seq4repair_space>stopped,<seq2seq4repair_space>removing<seq2seq4repair_space>from<seq2seq4repair_space>currentJobList" ) ) ; GewensteProces gp = new GewensteProces ( ) ; gp . getGewensteProcesByKey ( dbConnection , Integer . toString ( rp . ID ( ) ) ) ; if ( ! ( rp . stoppedWithError ( ) ) ) { processFinishedProcess ( dbConnection , gp ) ; } else { gp . updateStatus ( dbConnection , 10 ) ; } i . remove ( ) ; } } if ( ( processList . size ( ) ) < ( aantalConcurrentJobs ) ) { GewensteProces gp = new GewensteProces ( ) ; if ( gp . getFirstGewensteProcesByStatus ( dbConnection , 3 ) ) { processFinishedProcess ( dbConnection , gp ) ; } else if ( gp . getFirstGewensteProcesByStatus ( dbConnection , 4 ) ) { processFinishedProcess ( dbConnection , gp ) ; } else if ( gp . getFirstGewensteProcesByStatus ( dbConnection , 0 ) ) { gp . updateStatus ( dbConnection , 1 ) ; WAD_ProcessThread p = new WAD_ProcessThread ( ) ; try { teller = 0 ; String [ ] command ; String anaModuleFile = ReadFromIqcDatabase . getAnalyseModuleBySelectorFk ( dbConnection , gp . getSelectorKey ( ) ) ; String input = ( ReadConfigXML . readFileElement ( "XML" ) ) + ( ReadFromIqcDatabase . getFilenameFromTable ( dbConnection , "analysemodule_input" , gp . getInputKey ( ) ) ) ; input = input . replace ( "//" , File . separator ) ; String outputFolder = ( ReadConfigXML . readFileElement ( "XML" ) ) + ( ReadFromIqcDatabase . getFilenameFromTable ( dbConnection , "analysemodule_output" , gp . getInputKey ( ) ) ) ; <START_BUG> outputFolder . replace ( "//" , File . separator ) ; <END_BUG> outputFolder = outputFolder . substring ( 0 , outputFolder . lastIndexOf ( File . separator ) ) ; p . set_outputFolder ( outputFolder ) ; if ( matchExtension ( anaModuleFile , "jar" ) ) { command = new String [ 4 ] ; command [ 0 ] = "java" ; command [ 1 ] = "-jar" ; command [ 2 ] = anaModuleFile ; command [ 3 ] = ( "\"" + input ) + "\"" ; } else if ( matchExtension ( anaModuleFile , "py" ) ) { command = new String [ 3 ] ; command [ 0 ] = "python" ; command [ 1 ] = anaModuleFile ; command [ 2 ] = input ; } else if ( ( matchExtension ( anaModuleFile , "sh" ) ) && ( SystemUtils . IS_OS_LINUX ) ) { command = new String [ 3 ] ; command [ 0 ] = "bash" ; command [ 1 ] = anaModuleFile ; command [ 2 ] = input ; } else { command = new String [ 2 ] ; command [ 0 ] = anaModuleFile ; command [ 1 ] = ( "\"" + input ) + "\"" ; } gp . updateStatus ( dbConnection , 2 ) ; this . processID = Integer . parseInt ( gp . getKey ( ) ) ; p . newProcessThread ( command , processID ) ; processList . add ( processList . size ( ) , p ) ; p . setDaemon ( false ) ; p . start ( ) ; CheckNewJobs . log . info ( ( "Process<seq2seq4repair_space>id:<seq2seq4repair_space>" + ( processID ) ) ) ; } catch ( Exception e ) { processList . remove ( p ) ; CheckNewJobs . log . info ( ( "Problem<seq2seq4repair_space>starting<seq2seq4repair_space>task:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; gp . updateStatus ( dbConnection , 10 ) ; } } } else { CheckNewJobs . log . info ( ( "Cannot<seq2seq4repair_space>add<seq2seq4repair_space>process,<seq2seq4repair_space>current<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>processes:<seq2seq4repair_space>" + ( processList . size ( ) ) ) ) ; } PacsDatabaseConnection . closeDb ( dbConnection , null , null ) ; CheckNewJobs . log . info ( "Einde<seq2seq4repair_space>cyclus<seq2seq4repair_space>processor." ) ; if ( ReadConfigXML . readSettingsElement ( "stop" ) . equals ( "1" ) ) { if ( ( teller ) == 5 ) { CheckNewJobs . log . info ( "Afsluiten<seq2seq4repair_space>processor." ) ; this . cancel ( ) ; System . exit ( 0 ) ; } } } private boolean matchExtension ( String filename , String ext ) { } private void processFinishedProcess ( Connection dbConnection , GewensteProces gp ) { } }

Fix:
outputFolder = outputFolder . replace ( "//" , File . separator ) ;