Source:
<code>private void buildGeneralParameters() { EventCartridge ec = new EventCartridge(); ec.addEventHandler(new EscapeHtmlReference()); context.attachEventCartridge(ec); context.put("counter", new Counter()); context.put("util", Util.INSTANCE); context.put("stepNameFormatter", StepNameFormatter.INSTANCE); context.put("run_with_jenkins", configuration.containsPresentationMode(PresentationMode.RUN_WITH_JENKINS)); context.put("expand_all_steps", configuration.containsPresentationMode(PresentationMode.EXPAND_ALL_STEPS)); context.put("hide_empty_hooks", configuration.containsReducingMethod(ReducingMethod.HIDE_EMPTY_HOOKS)); context.put("trends_available", configuration.isTrendsAvailable()); context.put("build_project_name", configuration.getProjectName()); context.put("build_number", configuration.getBuildNumber()); String buildUrl = configuration.getBuildUrl(); if (StringUtils.isNotBlank(buildUrl)) { context.put("build_url", buildUrl); String buildName = configuration.getBuildName(); <START> if (StringUtils.isBlank(buildName)) { <END> buildName = "Build #" + configuration.getBuildNumber(); } context.put("build_name", buildName); } String formattedTime = reportResult != null ? reportResult.getBuildTime() : ReportResult.getCurrentTime(); context.put("build_time", formattedTime); String buildNumber = configuration.getBuildNumber(); if (StringUtils.isNotBlank(buildNumber) && configuration.containsPresentationMode(PresentationMode.RUN_WITH_JENKINS)) { if (NumberUtils.isCreatable(buildNumber)) { context.put("build_previous_number", Integer.parseInt(buildNumber) - 1); } else { LOG.log(Level.INFO, "Could not parse build number: {0}.", configuration.getBuildNumber()); } } }</code><technical_language><LINK_0></technical_language>

Target:
private void buildGeneralParameters() { EventCartridge ec = new EventCartridge(); ec.addEventHandler(new EscapeHtmlReference()); context.attachEventCartridge(ec); context.put("counter", new Counter()); context.put("util", Util.INSTANCE); context.put("stepNameFormatter", StepNameFormatter.INSTANCE); context.put("run_with_jenkins", configuration.containsPresentationMode(PresentationMode.RUN_WITH_JENKINS)); context.put("expand_all_steps", configuration.containsPresentationMode(PresentationMode.EXPAND_ALL_STEPS)); context.put("hide_empty_hooks", configuration.containsReducingMethod(ReducingMethod.HIDE_EMPTY_HOOKS)); context.put("trends_available", configuration.isTrendsAvailable()); context.put("build_project_name", configuration.getProjectName()); context.put("build_number", configuration.getBuildNumber()); String buildUrl = configuration.getBuildUrl(); if (StringUtils.isNotBlank(buildUrl)) { context.put("build_url", buildUrl); String buildName = StringUtils.defaultIfBlank( configuration.getBuildName(), "Build #" + configuration.getBuildNumber() ); context.put("build_name", buildName); } String formattedTime = reportResult != null ? reportResult.getBuildTime() : ReportResult.getCurrentTime(); context.put("build_time", formattedTime); String buildNumber = configuration.getBuildNumber(); if (StringUtils.isNotBlank(buildNumber) && configuration.containsPresentationMode(PresentationMode.RUN_WITH_JENKINS)) { if (NumberUtils.isCreatable(buildNumber)) { context.put("build_previous_number", Integer.parseInt(buildNumber) - 1); } else { LOG.log(Level.INFO, "Could not parse build number: {0}.", configuration.getBuildNumber()); } } }