Source:
<code>private void handleOneRequest(AnalysisTask request) { if (request.isHighPriority()) { lastHighPriorityTaskProcessed = System.currentTimeMillis(); if (!sideChannelOpen) { openSideChannel(); } } if (dryRunFailureRate >= 0) { try { Thread.sleep(random.nextInt(5000) + 1000); } catch (InterruptedException e) { e.printStackTrace(); } if (random.nextInt(100) >= dryRunFailureRate) { deleteRequest(request); } else { LOG.info("Intentionally failing to complete task for testing purposes {}", request.taskId); } return; } try { long startTime = System.currentTimeMillis(); LOG.info("Handling message {}", request.toString()); long graphStartTime = System.currentTimeMillis(); networkId = request.graphId; TransportNetwork transportNetwork = null; try { transportNetwork = transportNetworkCache.getNetworkForScenario(networkId, request); } catch (ScenarioApplicationException scenarioException) { reportTaskErrors(request.taskId, HttpStatus.BAD_REQUEST_400, scenarioException.taskErrors); return; } <START> if(request.taskId == 0 && request.outputBucket != null && !"".equals(request.outputBucket)){ <END> MultipointMetadata mm = new MultipointMetadata(request, transportNetwork); LOG.info("This is the lead-off task for a static site request; writing shared metadata"); mm.write(); } TravelTimeComputer computer = new TravelTimeComputer(request, transportNetwork, gridCache); if (request.isHighPriority()) { PipedInputStream pis = new PipedInputStream(); GZIPOutputStream pos = new GZIPOutputStream(new PipedOutputStream(pis)); finishPriorityTask(request, pis, "application/octet-stream", "gzip"); computer.computeTravelTimes(pos); pos.close(); } else { computer.computeTravelTimes(null); deleteRequest(request); } } catch (Exception ex) { TaskError taskError = new TaskError(ex); LOG.error("An error occurred while routing", ex); reportTaskErrors(request.taskId, HttpStatus.INTERNAL_SERVER_ERROR_500, Arrays.asList(taskError)); } }</code><technical_language>!request.outputBucket.isEmpty() get rid of null check. If !"".equals(request.outputBucket) work if string is null</technical_language>

Target:
private void handleOneRequest(AnalysisTask request) { if (request.isHighPriority()) { lastHighPriorityTaskProcessed = System.currentTimeMillis(); if (!sideChannelOpen) { openSideChannel(); } } if (dryRunFailureRate >= 0) { try { Thread.sleep(random.nextInt(5000) + 1000); } catch (InterruptedException e) { e.printStackTrace(); } if (random.nextInt(100) >= dryRunFailureRate) { deleteRequest(request); } else { LOG.info("Intentionally failing to complete task for testing purposes {}", request.taskId); } return; } try { long startTime = System.currentTimeMillis(); LOG.info("Handling message {}", request.toString()); long graphStartTime = System.currentTimeMillis(); networkId = request.graphId; TransportNetwork transportNetwork = null; try { transportNetwork = transportNetworkCache.getNetworkForScenario(networkId, request); } catch (ScenarioApplicationException scenarioException) { reportTaskErrors(request.taskId, HttpStatus.BAD_REQUEST_400, scenarioException.taskErrors); return; } if(request.taskId == 0 && request.outputBucket != null && !request.outputBucket.isEmpty()){ MultipointMetadata mm = new MultipointMetadata(request, transportNetwork); LOG.info("This is the lead-off task for a static site request; writing shared metadata"); mm.write(); } TravelTimeComputer computer = new TravelTimeComputer(request, transportNetwork, gridCache); if (request.isHighPriority()) { PipedInputStream pis = new PipedInputStream(); GZIPOutputStream pos = new GZIPOutputStream(new PipedOutputStream(pis)); finishPriorityTask(request, pis, "application/octet-stream", "gzip"); computer.computeTravelTimes(pos); pos.close(); } else { computer.computeTravelTimes(null); deleteRequest(request); } } catch (Exception ex) { TaskError taskError = new TaskError(ex); LOG.error("An error occurred while routing", ex); reportTaskErrors(request.taskId, HttpStatus.INTERNAL_SERVER_ERROR_500, Arrays.asList(taskError)); } }