Source:
<code>public EList<Widget> renderWidget(Widget w, StringBuilder sb) throws RenderException { Chart chart = (Chart) w; try { String itemParam = null; Item item = itemUIRegistry.getItem(chart.getItem()); if (item instanceof GroupItem) { itemParam = "groups=" + chart.getItem(); } else { itemParam = "items=" + chart.getItem(); } String chartUrl = "/chart?" + itemParam + "&period=" + chart.getPeriod(); if (chart.getService() != null) { chartUrl += "&service=" + chart.getService(); } if (chart.getLegend() != null) { if (chart.getLegend()) { chartUrl += "&legend=true"; } else { chartUrl += "&legend=false"; } } String chartTheme = null; switch (config.getTheme()) { case WebAppConfig.THEME_NAME_DEFAULT: chartTheme = "bright"; break; case WebAppConfig.THEME_NAME_DARK: chartTheme = "dark"; break; } if (chartTheme != null) { chartUrl += "&theme=" + chartTheme; } String url; if (!itemUIRegistry.getVisiblity(w)) { <START> url = "images/none.png"; <END> } else { url = chartUrl + "&t=" + (new Date()).getTime(); } String snippet = getSnippet("chart"); snippet = preprocessSnippet(snippet, w); if (chart.getRefresh() > 0) { snippet = StringUtils.replace(snippet, "%update_interval%", Integer.toString(chart.getRefresh())); } else { snippet = StringUtils.replace(snippet, "%update_interval%", "0"); } snippet = StringUtils.replace(snippet, "%id%", itemUIRegistry.getWidgetId(w)); snippet = StringUtils.replace(snippet, "%proxied_url%", chartUrl); snippet = StringUtils.replace(snippet, "%valid_url%", "true"); snippet = StringUtils.replace(snippet, "%url%", url); sb.append(snippet); } catch (ItemNotFoundException e) { logger.warn("Chart cannot be rendered as item '{}' does not exist.", chart.getItem()); } return null; }</code><technical_language>Feels a bit weird here, a static const maybe</technical_language>

Target:
public EList<Widget> renderWidget(Widget w, StringBuilder sb) throws RenderException { Chart chart = (Chart) w; try { String itemParam = null; Item item = itemUIRegistry.getItem(chart.getItem()); if (item instanceof GroupItem) { itemParam = "groups=" + chart.getItem(); } else { itemParam = "items=" + chart.getItem(); } String chartUrl = "/chart?" + itemParam + "&period=" + chart.getPeriod(); if (chart.getService() != null) { chartUrl += "&service=" + chart.getService(); } if (chart.getLegend() != null) { if (chart.getLegend()) { chartUrl += "&legend=true"; } else { chartUrl += "&legend=false"; } } String chartTheme = null; switch (config.getTheme()) { case WebAppConfig.THEME_NAME_DEFAULT: chartTheme = "bright"; break; case WebAppConfig.THEME_NAME_DARK: chartTheme = "dark"; break; } if (chartTheme != null) { chartUrl += "&theme=" + chartTheme; } String url; boolean ignoreRefresh; if (!itemUIRegistry.getVisiblity(w)) { url = URL_NONE_ICON; ignoreRefresh = true; } else { url = chartUrl + "&t=" + (new Date()).getTime(); ignoreRefresh = false; } String snippet = getSnippet("chart"); snippet = preprocessSnippet(snippet, w); if (chart.getRefresh() > 0) { snippet = StringUtils.replace(snippet, "%update_interval%", Integer.toString(chart.getRefresh())); } else { snippet = StringUtils.replace(snippet, "%update_interval%", "0"); } snippet = StringUtils.replace(snippet, "%id%", itemUIRegistry.getWidgetId(w)); snippet = StringUtils.replace(snippet, "%proxied_url%", chartUrl); snippet = StringUtils.replace(snippet, "%valid_url%", "true"); snippet = StringUtils.replace(snippet, "%ignore_refresh%", ignoreRefresh ? "true" : "false"); snippet = StringUtils.replace(snippet, "%url%", url); sb.append(snippet); } catch (ItemNotFoundException e) { logger.warn("Chart cannot be rendered as item '{}' does not exist.", chart.getItem()); } return null; }