Buggy code:
public class BatchRun { Sigar s = new Sigar ( ) ; ProgressEstimator pe ; @ Parameter ( names = "-help" , help = true , description = "Print<seq2seq4repair_space>the<seq2seq4repair_space>help" , hidden = true ) private final boolean help = false ; private static transient Logger logger = LoggerFactory . getLogger ( BatchRun . class ) ; BatchRun . RamGobbler ramGobbler = new BatchRun . RamGobbler ( ) ; @ Parameter ( names = "-reservedMemory" , description = "the<seq2seq4repair_space>memory<seq2seq4repair_space>(in<seq2seq4repair_space>MB)<seq2seq4repair_space>to<seq2seq4repair_space>reserve<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>system.<seq2seq4repair_space>If<seq2seq4repair_space>not<seq2seq4repair_space>set,<seq2seq4repair_space>it<seq2seq4repair_space>will<seq2seq4repair_space>be<seq2seq4repair_space>estimated" ) Integer reservedMemory ; @ Parameter ( names = "-jarFile" , description = "The<seq2seq4repair_space>path<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>jar<seq2seq4repair_space>file<seq2seq4repair_space>to<seq2seq4repair_space>execute" , required = true ) Path jarPath ; @ Parameter ( names = "-fileType" , description = "The<seq2seq4repair_space>config<seq2seq4repair_space>file<seq2seq4repair_space>type<seq2seq4repair_space>(e.g.<seq2seq4repair_space>.xml)" , required = true ) String fileType ; @ Parameter ( names = "-maxHeap" , description = "The<seq2seq4repair_space>heap<seq2seq4repair_space>size<seq2seq4repair_space>for<seq2seq4repair_space>each<seq2seq4repair_space>job<seq2seq4repair_space>in<seq2seq4repair_space>MB.<seq2seq4repair_space>If<seq2seq4repair_space>not<seq2seq4repair_space>set,<seq2seq4repair_space>will<seq2seq4repair_space>be<seq2seq4repair_space>auto<seq2seq4repair_space>adjusted<seq2seq4repair_space>based<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>available<seq2seq4repair_space>RAM<seq2seq4repair_space>and<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>cores" ) Integer maxHeap ; @ Parameter ( names = "-configFolder" , description = "The<seq2seq4repair_space>folder<seq2seq4repair_space>with<seq2seq4repair_space>the<seq2seq4repair_space>config<seq2seq4repair_space>files" , required = true ) Path configFolder ; @ Parameter ( names = "-searchRecursive" , description = "Set<seq2seq4repair_space>to<seq2seq4repair_space>search<seq2seq4repair_space>config<seq2seq4repair_space>files<seq2seq4repair_space>recursively" ) boolean searchRecursive = false ; @ Parameter ( names = "-reserveSystemCore" , arity = 1 , description = "Set<seq2seq4repair_space>to<seq2seq4repair_space>false<seq2seq4repair_space>s.t.<seq2seq4repair_space>there<seq2seq4repair_space>is<seq2seq4repair_space>no<seq2seq4repair_space>core<seq2seq4repair_space>reserved<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>system" ) boolean reserveSystemCore = true ; @ Parameter ( names = "-ramMonitorInterval" , description = "how<seq2seq4repair_space>long<seq2seq4repair_space>to<seq2seq4repair_space>wait<seq2seq4repair_space>(in<seq2seq4repair_space>ms)<seq2seq4repair_space>until<seq2seq4repair_space>to<seq2seq4repair_space>look<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>memory<seq2seq4repair_space>consumption<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>running<seq2seq4repair_space>jobs" ) int ramMonitorWaitingTime = 10000 ; @ Parameter ( names = "-concurrentJobs" , description = "how<seq2seq4repair_space>many<seq2seq4repair_space>jobs<seq2seq4repair_space>will<seq2seq4repair_space>run<seq2seq4repair_space>in<seq2seq4repair_space>parallel.<seq2seq4repair_space>If<seq2seq4repair_space>not<seq2seq4repair_space>set<seq2seq4repair_space>this<seq2seq4repair_space>will<seq2seq4repair_space>be<seq2seq4repair_space>the<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>cores<seq2seq4repair_space>(maybe<seq2seq4repair_space>-1<seq2seq4repair_space>for<seq2seq4repair_space>a<seq2seq4repair_space>system<seq2seq4repair_space>core)" ) Integer jobsParameter ; @ Parameter ( names = "-forceSettings" , description = "Force<seq2seq4repair_space>using<seq2seq4repair_space>the<seq2seq4repair_space>specified<seq2seq4repair_space>settings<seq2seq4repair_space>(can<seq2seq4repair_space>cause<seq2seq4repair_space>paging<seq2seq4repair_space>etc)" ) boolean forceSettings = false ; @ Parameter ( names = "-jcommander" , description = "Called<seq2seq4repair_space>jar<seq2seq4repair_space>expects<seq2seq4repair_space>config<seq2seq4repair_space>files<seq2seq4repair_space>in<seq2seq4repair_space>jcommander<seq2seq4repair_space>format.<seq2seq4repair_space>Will<seq2seq4repair_space>prepend<seq2seq4repair_space>an<seq2seq4repair_space>'@'<seq2seq4repair_space>in<seq2seq4repair_space>front<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>properties<seq2seq4repair_space>file" ) boolean isJCommanderFormat = false ; public static void main ( final String [ ] args ) throws InterruptedException { } int jobCount = 0 ; public void run ( ) throws InterruptedException { } ExecutorService gobblePool = null ; private void maxHeapHeuristic ( final int ram , final int jobs ) { } private void exitWithUsage ( ) { } private void startProcess ( final Path jarPath , final Path f ) { <START_BUG> final String configString = ( isJCommanderFormat ) ? "@" : "" + ( f . toAbsolutePath ( ) . toString ( ) ) ; <END_BUG> final String [ ] command = new String [ ] { "java" , "-XX:HeapDumpPath=" + ( jarPath . toAbsolutePath ( ) . getParent ( ) . toString ( ) ) , "-XX:+HeapDumpOnOutOfMemoryError" , ( "-Xmx" + ( maxHeap ) ) + "M" , "-jar" , jarPath . toAbsolutePath ( ) . toString ( ) , configString } ; BatchRun . logger . info ( "Starting<seq2seq4repair_space>job<seq2seq4repair_space>with<seq2seq4repair_space>config<seq2seq4repair_space>{}" , configString ) ; final String jobQualifier = f . toAbsolutePath ( ) . toString ( ) ; final ProcessBuilder pb = new ProcessBuilder ( command ) ; Process proc ; int exitVal = - 1 ; try { proc = pb . start ( ) ; final BatchRun . StreamGobbler errorGobbler = new BatchRun . StreamGobbler ( proc . getErrorStream ( ) , OutputType . ERROR ) ; final BatchRun . StreamGobbler outputGobbler = new BatchRun . StreamGobbler ( proc . getInputStream ( ) , OutputType . INFO ) ; errorGobbler . start ( ) ; outputGobbler . start ( ) ; ramGobbler . jobStarted ( jobQualifier ) ; exitVal = proc . waitFor ( ) ; BatchRun . logger . info ( "ExitValue={}<seq2seq4repair_space>for<seq2seq4repair_space>config<seq2seq4repair_space>{}" , exitVal , f . toAbsolutePath ( ) ) ; if ( exitVal != 0 ) { BatchRun . logger . warn ( "WARNING:<seq2seq4repair_space>config<seq2seq4repair_space>{}<seq2seq4repair_space>exited<seq2seq4repair_space>with<seq2seq4repair_space>errorcode={}" , f . toAbsolutePath ( ) , exitVal ) ; } pe . jobFinished ( jobQualifier ) ; ramGobbler . jobFinished ( jobQualifier ) ; } catch ( IOException | InterruptedException | SigarException e ) { BatchRun . logger . error ( "Job<seq2seq4repair_space>for<seq2seq4repair_space>file<seq2seq4repair_space>{}<seq2seq4repair_space>threw<seq2seq4repair_space>an<seq2seq4repair_space>exception" , f , e ) ; } BatchRun . logger . info ( "Finished<seq2seq4repair_space>job<seq2seq4repair_space>{}<seq2seq4repair_space>(out<seq2seq4repair_space>of<seq2seq4repair_space>{}).<seq2seq4repair_space>It<seq2seq4repair_space>took<seq2seq4repair_space>{}" , pe . getJobsFinished ( ) , jobCount , pe . getLastJobTimeString ( ) ) ; BatchRun . logger . info ( "Average<seq2seq4repair_space>job<seq2seq4repair_space>duration<seq2seq4repair_space>until<seq2seq4repair_space>now:<seq2seq4repair_space>{}" , pe . getAverageJobTimeString ( ) ) ; BatchRun . logger . info ( "Estimated<seq2seq4repair_space>remaining<seq2seq4repair_space>time:<seq2seq4repair_space>{}\n" , pe . getRemainingTimeString ( ) ) ; } class RamGobbler extends Thread { TLongIntMap ramNeededMaxPerJob = new TLongIntHashMap ( 100 , 0.5F , BatchRun . RamGobbler . NO_ENTRY_VALUE , BatchRun . RamGobbler . NO_ENTRY_VALUE ) ; TLongSet runningProcesses = new TLongHashSet ( ) ; private static final int NO_ENTRY_VALUE = - 1 ; String query = "State.Name.eq=java,Args.6.eq=" ; TObjectLongMap < String > argPidCache = new TObjectLongHashMap < > ( ) ; HashSet < String > notWatchedProcesses = new HashSet < > ( ) ; Semaphore sem = new Semaphore ( 1 ) ; static final long PID_NOT_FOUND = - 1 ; AtomicBoolean shutdown = new AtomicBoolean ( false ) ; public void shutdown ( ) { } public void jobFinished ( final String commandArg ) throws InterruptedException , SigarException { } public void jobStarted ( final String commandArg ) throws InterruptedException , SigarException { } private long getPidForCommandArg ( final String commandArg ) throws SigarException { } public int minRamNeeded ( ) { } public int maxRamNeeded ( ) { } public int averageRamNeeded ( ) { } @ Override public void run ( ) { } private void lookForUnfoundProcesses ( ) { } } private void gobbleStream ( final InputStream is , final OutputType type ) { } static class StreamGobbler extends Thread { InputStream is ; OutputType type ; StreamGobbler ( final InputStream is , final OutputType type ) { } @ Override public void run ( ) { } } }

Fix:
final String configString = ( isJCommanderFormat ? "@" : "" ) + ( f . toAbsolutePath ( ) . toString ( ) ) ;