Buggy code:
@ Singleton public class RunQueue { private static final Logger LOG = LoggerFactory . getLogger ( RunQueue . class ) ; private static final long CHECK_BUILD_RESULT_PERIOD = 2000 ; private static final long CHECK_AVAILABLE_RUNNER_PERIOD = 2000 ; private static final long PROCESS_CLEANER_PERIOD = TimeUnit . MINUTES . toMillis ( 1 ) ; private static final int DEFAULT_MAX_MEMORY_SIZE = 512 ; private static final int APPLICATION_CHECK_URL_TIMEOUT = 2000 ; private static final int APPLICATION_CHECK_URL_COUNT = 30 ; private static final AtomicLong sequence = new AtomicLong ( 1 ) ; private final ConcurrentMap < String , RemoteRunnerServer > runnerServers ; private final RunnerSelectionStrategy runnerSelector ; private final ConcurrentMap < RunQueue . RunnerListKey , Set < RemoteRunner > > runnerListMapping ; private final ConcurrentMap < Long , RunQueueTask > tasks ; private final int defMemSize ; private final EventService eventService ; private final String baseWorkspaceApiUrl ; private final String baseProjectApiUrl ; private final String baseBuilderApiUrl ; private final int defLifetime ; private final long maxWaitingTimeMillis ; private final AtomicBoolean started ; private final long appCleanupTime ; private final Lock [ ] resourceCheckerLocks ; private final int resourceCheckerMask ; private ExecutorService executor ; private ScheduledExecutorService cleanScheduler ; @ Inject ( optional = true ) @ Named ( Constants . RUNNER_SLAVE_RUNNER_URLS ) private String [ ] slaves = new String [ 0 ] ; @ Inject ( optional = true ) @ Named ( Constants . RUNNER_SLAVE_RUNNER_URLS_PAID ) private String [ ] slavesPaid = new String [ 0 ] ; @ Inject ( optional = true ) @ Named ( Constants . RUNNER_SLAVE_RUNNER_URLS_ALWAYS_ON ) private String [ ] slavesAlwaysOn = new String [ 0 ] ; @ Inject ( optional = true ) @ Named ( Constants . RUNNER_WS_MAX_MEMORY_SIZE ) private int defMaxMemorySize = RunQueue . DEFAULT_MAX_MEMORY_SIZE ; long cleanerPeriod = RunQueue . PROCESS_CLEANER_PERIOD ; long checkAvailableRunnerPeriod = RunQueue . CHECK_AVAILABLE_RUNNER_PERIOD ; long checkBuildResultPeriod = RunQueue . CHECK_BUILD_RESULT_PERIOD ; @ Inject @ SuppressWarnings ( "unchecked" ) public RunQueue ( @ Nullable @ Named ( "workspace.base_api_url" ) String baseWorkspaceApiUrl , @ Nullable @ Named ( "project.base_api_url" ) String baseProjectApiUrl , @ Nullable @ Named ( "builder.base_api_url" ) String baseBuilderApiUrl , @ Named ( Constants . APP_DEFAULT_MEM_SIZE ) int defMemSize , @ Named ( Constants . WAITING_TIME ) int maxWaitingTime , @ Named ( Constants . APP_LIFETIME ) int defLifetime , @ Named ( Constants . APP_CLEANUP_TIME ) int appCleanupTime , RunnerSelectionStrategy runnerSelector , EventService eventService ) { } public RunQueueTask getTask ( Long id ) throws NotFoundException { } public List < ? extends RunQueueTask > getTasks ( ) { } @ PostConstruct public void start ( ) { } protected void checkStarted ( ) { } @ PreDestroy public void stop ( ) { } public RunQueueTask run ( String workspace , String project , ServiceContext serviceContext , RunOptions runOptions ) throws RunnerException { } private void resolveProjectRunnerEnvironments ( String infra , RunRequest request , ProjectDescriptor projectDescriptor , String envName , List < RemoteRunner > matchedRunners ) throws RunnerException { final List < String > recipesUrls = new LinkedList < > ( ) ; for ( ItemReference recipe : getProjectRunnerRecipes ( projectDescriptor , envName ) ) { <START_BUG> if ( "file" . equals ( recipe . getType ( ) ) ) { <END_BUG> if ( recipe . getName ( ) . equals ( "Dockerfile" ) ) { request . setRunner ( "docker" ) ; } final Link contentLink = recipe . getLink ( LINK_REL_GET_CONTENT ) ; recipesUrls . add ( contentLink . getHref ( ) ) ; } } if ( ( request . getRunner ( ) ) == null ) { throw new RunnerException ( ( ( ( "You<seq2seq4repair_space>requested<seq2seq4repair_space>a<seq2seq4repair_space>run<seq2seq4repair_space>and<seq2seq4repair_space>your<seq2seq4repair_space>project<seq2seq4repair_space>with<seq2seq4repair_space>custom<seq2seq4repair_space>environment." + "<seq2seq4repair_space>The<seq2seq4repair_space>runner<seq2seq4repair_space>was<seq2seq4repair_space>unable<seq2seq4repair_space>to<seq2seq4repair_space>get<seq2seq4repair_space>any<seq2seq4repair_space>supported<seq2seq4repair_space>recipe<seq2seq4repair_space>files<seq2seq4repair_space>in<seq2seq4repair_space>environment<seq2seq4repair_space>'" ) + envName ) + "'" ) ) ; } request . setRecipeUrls ( recipesUrls ) ; final Set < RemoteRunner > runnerList = getRunnerList ( infra , request . getWorkspace ( ) , request . getProject ( ) ) ; if ( runnerList != null ) { for ( RemoteRunner runner : runnerList ) { if ( request . getRunner ( ) . equals ( runner . getName ( ) ) ) { matchedRunners . add ( runner ) ; } } } } WorkspaceDescriptor getWorkspaceDescriptor ( String workspace , ServiceContext serviceContext ) throws RunnerException { } ProjectDescriptor getProjectDescriptor ( String workspace , String project , ServiceContext serviceContext ) throws RunnerException { } Set < RemoteRunner > getRunnerList ( String infra , String workspace , String project ) { } void checkResources ( WorkspaceDescriptor workspace , RunRequest request ) throws RunnerException { } void checkMemory ( String wsId , int availableMem , int mem ) throws RunnerException { } int getUsedMemory ( String workspaceId ) { } int getTotalMemory ( WorkspaceDescriptor workspace ) throws RunnerException { } int getTotalMemory ( String workspaceId , ServiceContext serviceContext ) throws RunnerException { } RemoteServiceDescriptor getBuilderServiceDescriptor ( String workspace , ServiceContext serviceContext ) { } BuildTaskDescriptor startBuild ( RemoteServiceDescriptor builderService , String project , BuildOptions buildOptions ) throws RunnerException { } protected Callable < RemoteRunnerProcess > createTaskFor ( final List < RemoteRunner > matched , final RunRequest request , final ValueHolder < BuildTaskDescriptor > buildTaskHolder ) { } List < ItemReference > getProjectRunnerRecipes ( ProjectDescriptor projectDescriptor , String envName ) throws RunnerException { } boolean tryCancelBuild ( BuildTaskDescriptor buildDescriptor ) { } protected EventService getEventService ( ) { } public List < RemoteRunnerServer > getRegisterRunnerServers ( ) { } public boolean registerRunnerServer ( RunnerServerRegistration registration ) throws RunnerException { } RemoteRunnerServer createRemoteRunnerServer ( String url ) { } boolean doRegisterRunnerServer ( RemoteRunnerServer runnerServer ) throws RunnerException { } public boolean unregisterRunnerServer ( RunnerServerLocation location ) throws RunnerException { } boolean doUnregisterRunners ( String url ) { } private String getUserToken ( ) { } private class RegisterSlaveRunnerTask implements Runnable { final String [ ] mySlaves ; final String infra ; RegisterSlaveRunnerTask ( String [ ] mySlaves , String infra ) { } @ Override public void run ( ) { } }

Fix:
if ( "file" . equals ( recipe . getItemType ( ) ) ) {