Buggy code:
public class JenkinsScheduler implements Scheduler { private static final String SLAVE_JAR_URI_SUFFIX = "jnlpJars//slave.jar" ; private static final Long MINIMUM_TIME_TO_LIVE = TimeUnit . MINUTES . toMillis ( 1 ) ; private static final double JVM_MEM_OVERHEAD_FACTOR = 0.1 ; private static final String SLAVE_COMMAND_FORMAT = "java<seq2seq4repair_space>-DHUDSON_HOME=jenkins<seq2seq4repair_space>-server<seq2seq4repair_space>-Xmx%dm<seq2seq4repair_space>%s<seq2seq4repair_space>-jar<seq2seq4repair_space>${MESOS_SANDBOX-.}//slave.jar<seq2seq4repair_space>%s<seq2seq4repair_space>%s<seq2seq4repair_space>-jnlpUrl<seq2seq4repair_space>%s" ; private static final String JNLP_SECRET_FORMAT = "-secret<seq2seq4repair_space>%s" ; public static final String PORT_RESOURCE_NAME = "ports" ; private Queue < JenkinsScheduler . Request > requests ; private Set < String > unmatchedLabels ; private Map < TaskID , JenkinsScheduler . Result > results ; private Set < TaskID > finishedTasks ; private volatile SchedulerDriver driver ; private String jenkinsMaster ; private volatile MesosCloud mesosCloud ; private volatile boolean running ; private long startedTime ; private static final Logger LOGGER = Logger . getLogger ( JenkinsScheduler . class . getName ( ) ) ; public static final Lock SUPERVISOR_LOCK = new ReentrantLock ( ) ; private static int lruCacheSize = Integer . getInteger ( ( ( JenkinsScheduler . class . getName ( ) ) + ".lruCacheSize" ) , 10 ) ; private static LRUMap < String , Object > recentlyAcceptedOffers = new LRUMap < String , Object > ( JenkinsScheduler . lruCacheSize ) ; private static final Object IGNORE = new Object ( ) ; public JenkinsScheduler ( String jenkinsMaster , MesosCloud mesosCloud ) { } public synchronized void init ( ) { } public synchronized void stop ( ) { } public synchronized boolean isRunning ( ) { } public synchronized void requestJenkinsSlave ( Mesos . SlaveRequest request , Mesos . SlaveResult result ) { } public boolean reachedMinimumTimeToLive ( ) { } private String getJnlpUrl ( String slaveName ) { } private String getJnlpSecret ( String slaveName ) { } private static String joinPaths ( String prefix , String suffix ) { } public synchronized void terminateJenkinsSlave ( String name ) { } @ Override public void registered ( SchedulerDriver driver , FrameworkID frameworkId , MasterInfo masterInfo ) { } @ Override public void reregistered ( SchedulerDriver driver , MasterInfo masterInfo ) { } @ Override public void disconnected ( SchedulerDriver driver ) { } @ Override public synchronized void resourceOffers ( SchedulerDriver driver , List < Offer > offers ) { } public synchronized Set < String > getUnmatchedLabels ( ) { } private void reArrangeOffersBasedOnAffinity ( List < Offer > offers ) { } private void reArrangeOffersBasedOnAffinity ( List < Offer > offers , String recentSlaveId ) { } private int getOfferIndex ( List < Offer > offers , String recentSlaveId ) { } private boolean matches ( Offer offer , JenkinsScheduler . Request request ) { } private boolean slaveAttributesMatch ( Offer offer , JSONObject slaveAttributes ) { } @ VisibleForTesting void setDriver ( SchedulerDriver driver ) { } @ VisibleForTesting SortedSet < Long > findPortsToUse ( Offer offer , int maxCount ) { } private void createMesosTask ( Offer offer , JenkinsScheduler . Request request ) { } @ NonNull private static Jenkins getJenkins ( ) { } private void detectAndAddAdditionalURIs ( JenkinsScheduler . Request request , CommandInfo . Builder commandBuilder ) { } private Builder getTaskInfoBuilder ( Offer offer , JenkinsScheduler . Request request , TaskID taskId , CommandInfo . Builder commandBuilder ) { } private void getContainerInfoBuilder ( Offer offer , JenkinsScheduler . Request request , String slaveName , TaskInfo . Builder taskBuilder ) { } @ VisibleForTesting CommandInfo . Builder getCommandInfoBuilder ( JenkinsScheduler . Request request ) { } String generateJenkinsCommand2Run ( int jvmMem , String jvmArgString , String jnlpArgString , String slaveName ) { } private CommandInfo . Builder getBaseCommandBuilder ( JenkinsScheduler . Request request ) { CommandInfo . Builder commandBuilder = CommandInfo . newBuilder ( ) ; <START_BUG> String jenkinsCommand2Run = generateJenkinsCommand2Run ( request . request . mem , request . request . slaveInfo . getJvmArgs ( ) , request . request . slaveInfo . getJnlpArgs ( ) , request . request . slave . name ) ; <END_BUG> if ( ( ( request . request . slaveInfo . getContainerInfo ( ) ) != null ) && ( request . request . slaveInfo . getContainerInfo ( ) . getUseCustomDockerCommandShell ( ) ) ) { String customShell = request . request . slaveInfo . getContainerInfo ( ) . getCustomDockerCommandShell ( ) ; if ( ( StringUtils . stripToNull ( customShell ) ) == null ) { throw new IllegalArgumentException ( "Invalid<seq2seq4repair_space>custom<seq2seq4repair_space>shell<seq2seq4repair_space>argument<seq2seq4repair_space>supplied<seq2seq4repair_space>" ) ; } JenkinsScheduler . LOGGER . info ( String . format ( "About<seq2seq4repair_space>to<seq2seq4repair_space>use<seq2seq4repair_space>custom<seq2seq4repair_space>shell:<seq2seq4repair_space>%s<seq2seq4repair_space>" , customShell ) ) ; commandBuilder . setShell ( false ) ; commandBuilder . setValue ( customShell ) ; List args = new ArrayList ( ) ; args . add ( jenkinsCommand2Run ) ; commandBuilder . addAllArguments ( args ) ; } else { JenkinsScheduler . LOGGER . info ( "About<seq2seq4repair_space>to<seq2seq4repair_space>use<seq2seq4repair_space>default<seq2seq4repair_space>shell<seq2seq4repair_space>...." ) ; commandBuilder . setValue ( jenkinsCommand2Run ) ; } commandBuilder . addUris ( URI . newBuilder ( ) . setValue ( JenkinsScheduler . joinPaths ( jenkinsMaster , JenkinsScheduler . SLAVE_JAR_URI_SUFFIX ) ) . setExecutable ( false ) . setExtract ( false ) ) ; return commandBuilder ; } @ VisibleForTesting boolean isExistingTask ( TaskID taskId ) { } @ VisibleForTesting void refuseOffer ( Offer offer ) { } @ Override public void offerRescinded ( SchedulerDriver driver , OfferID offerId ) { } @ Override public void statusUpdate ( SchedulerDriver driver , TaskStatus status ) { } @ Override public void frameworkMessage ( SchedulerDriver driver , ExecutorID executorId , SlaveID slaveId , byte [ ] data ) { } @ Override public void slaveLost ( SchedulerDriver driver , SlaveID slaveId ) { } @ Override public void executorLost ( SchedulerDriver driver , ExecutorID executorId , SlaveID slaveId , int status ) { } @ Override public void error ( SchedulerDriver driver , String message ) { } private MesosCloud getMesosCloud ( ) { } protected void setMesosCloud ( MesosCloud mesosCloud ) { } private static class Result { private final SlaveResult result ; private final JenkinsSlave slave ;

Fix:
String jenkinsCommand2Run = generateJenkinsCommand2Run ( request . request . slaveInfo . getSlaveMem ( ) , request . request . slaveInfo . getJvmArgs ( ) , request . request . slaveInfo . getJnlpArgs ( ) , request . request . slave . name ) ;