Source:
<code>public ModelAndView list(@RequestParam("pipelineName")String pipelineName, @RequestParam(value = "perPage", required = false)Integer perPageParam, @RequestParam(value = "start", required = false)Integer startParam, @RequestParam(value = "labelFilter", required = false) String labelFilter, HttpServletResponse response, HttpServletRequest request) throws NamingException { PipelineConfig pipelineConfig = goConfigService.pipelineConfigNamed(new CaseInsensitiveString(pipelineName)); String username = CaseInsensitiveString.str(UserHelper.getUserName().getUsername()); Pagination pagination; try { pagination = Pagination.pageStartingAt(startParam, pipelineHistoryService.totalCount(pipelineName), perPageParam); } catch (Exception e) { Map<String, Object> json = new LinkedHashMap<>(); addDeveloperErrorMessage(json, e); return jsonNotAcceptable(json).respond(response); } PipelinePauseInfo pauseInfo = pipelinePauseService.pipelinePauseInfo(pipelineName); boolean hasBuildCauseInBuffer = pipelineScheduleQueue.hasBuildCause(CaseInsensitiveString.str(pipelineConfig.name())); <START> PipelineInstanceModels pipelineHistory = (labelFilter == null || labelFilter.trim().isEmpty()) ? <END> pipelineHistoryService.load(pipelineName, pagination, username, true) : pipelineHistoryService.findMatchingPipelineInstances(pipelineName, labelFilter, perPageParam, UserHelper.getUserName(), new HttpLocalizedOperationResult()); boolean hasForcedBuildCause = pipelineScheduleQueue.hasForcedBuildCause(pipelineName); PipelineHistoryJsonPresentationModel historyJsonPresenter = new PipelineHistoryJsonPresentationModel( pauseInfo, pipelineHistory, pipelineConfig, pagination, canForce(pipelineConfig, username), hasForcedBuildCause, hasBuildCauseInBuffer, canPause(pipelineConfig, username)); return jsonFound(historyJsonPresenter.toJson()).respond(response); }</code><technical_language>Sorry, missed this earlier. a utility method <LINK_0> for checking blank strings here</technical_language>

Target:
public ModelAndView list(@RequestParam("pipelineName")String pipelineName, @RequestParam(value = "perPage", required = false)Integer perPageParam, @RequestParam(value = "start", required = false)Integer startParam, @RequestParam(value = "labelFilter", required = false) String labelFilter, HttpServletResponse response, HttpServletRequest request) throws NamingException { PipelineConfig pipelineConfig = goConfigService.pipelineConfigNamed(new CaseInsensitiveString(pipelineName)); String username = CaseInsensitiveString.str(UserHelper.getUserName().getUsername()); Pagination pagination; try { pagination = Pagination.pageStartingAt(startParam, pipelineHistoryService.totalCount(pipelineName), perPageParam); } catch (Exception e) { Map<String, Object> json = new LinkedHashMap<>(); addDeveloperErrorMessage(json, e); return jsonNotAcceptable(json).respond(response); } PipelinePauseInfo pauseInfo = pipelinePauseService.pipelinePauseInfo(pipelineName); boolean hasBuildCauseInBuffer = pipelineScheduleQueue.hasBuildCause(CaseInsensitiveString.str(pipelineConfig.name())); PipelineInstanceModels pipelineHistory = StringUtil.isBlank(labelFilter) ? pipelineHistoryService.load(pipelineName, pagination, username, true) : pipelineHistoryService.findMatchingPipelineInstances(pipelineName, labelFilter, perPageParam, UserHelper.getUserName(), new HttpLocalizedOperationResult()); boolean hasForcedBuildCause = pipelineScheduleQueue.hasForcedBuildCause(pipelineName); PipelineHistoryJsonPresentationModel historyJsonPresenter = new PipelineHistoryJsonPresentationModel( pauseInfo, pipelineHistory, pipelineConfig, pagination, canForce(pipelineConfig, username), hasForcedBuildCause, hasBuildCauseInBuffer, canPause(pipelineConfig, username)); return jsonFound(historyJsonPresenter.toJson()).respond(response); }