Source:
public void init(ServletConfig config) throws ServletException { super.init(config); EngineLocalConfig engineLocalConfig = EngineLocalConfig.getInstance(); String configFilePath = ServletUtils.getAsAbsoluteContext( getServletContext().getContextPath(), engineLocalConfig.expandString( config.getInitParameter(CONFIG_FILE).replaceAll("%\\{", "\\${")) ); Set<Map.Entry<Object, Object>> properties = new HashSet<Map.Entry<Object, Object>>(); File configFile = new File(configFilePath); if (configFile.exists() && configFile.canRead()) { Properties p = new Properties(); try (FileInputStream fis = new FileInputStream(configFile)) { p.load(fis); properties = p.entrySet(); } catch (IOException e) { log.error("Problem parsing Properties file '{}'", configFile.getAbsolutePath()); log.error("Exception", e); } } for (Map.Entry<Object, Object> property : properties) { String key = (String) property.getKey(); if (key.startsWith(HELPTAGS_PREFIX)) { key = key.substring(HELPTAGS_PREFIX.length()); String[] jsonFiles = ((String) property.getValue()).trim().split("\\s*,\\s*"); List<JsonNode> nodes = new ArrayList<JsonNode>(); for (String jsonFile : jsonFiles) { File file = new File(configFile.getParent(), jsonFile); if (file.exists() && file.canRead()) { try { BufferedReader reader = new BufferedReader(new FileReader(file.getAbsolutePath())); nodes.add(mapper.readTree(reader)); } catch (IOException e) { log.error("Problem parsing documentation mapping file '{}'", file.getAbsolutePath()); log.error("Exception", e); } } } if (nodes.size() > 0) { JsonNode destination = nodes.get(0); for (int i = 1; i < nodes.size(); i++) { destination = merge(destination, nodes.get(i)); } this.cachedJson.put(key, destination.toString()); } } } }

Target:
public void init(ServletConfig config) throws ServletException { super.init(config); EngineLocalConfig engineLocalConfig = EngineLocalConfig.getInstance(); String configFilePath = ServletUtils.getAsAbsoluteContext( getServletContext().getContextPath(), engineLocalConfig.expandString( config.getInitParameter(CONFIG_FILE).replaceAll("%\\{", "\\${")) ); Set<Map.Entry<Object, Object>> properties = new HashSet<Map.Entry<Object, Object>>(); File configFile = new File(configFilePath); if (configFile.exists() && configFile.canRead()) { Properties p = new Properties(); try (FileInputStream fis = new FileInputStream(configFile)) { p.load(fis); properties = p.entrySet(); } catch (IOException e) { log.error("Problem parsing Properties file '{}': {}", configFile.getAbsolutePath(), e.getMessage()); log.debug("Exception", e); } } for (Map.Entry<Object, Object> property : properties) { String key = (String) property.getKey(); if (key.startsWith(HELPTAGS_PREFIX)) { key = key.substring(HELPTAGS_PREFIX.length()); String[] jsonFiles = ((String) property.getValue()).trim().split("\\s*,\\s*"); List<JsonNode> nodes = new ArrayList<JsonNode>(); for (String jsonFile : jsonFiles) { File file = new File(configFile.getParent(), jsonFile); if (file.exists() && file.canRead()) { try { BufferedReader reader = new BufferedReader(new FileReader(file.getAbsolutePath())); nodes.add(mapper.readTree(reader)); } catch (IOException e) { log.error("Problem parsing documentation mapping file '{}': {}", file.getAbsolutePath(), e.getMessage()); log.debug("Exception", e); } } } if (nodes.size() > 0) { JsonNode destination = nodes.get(0); for (int i = 1; i < nodes.size(); i++) { destination = merge(destination, nodes.get(i)); } this.cachedJson.put(key, destination.toString()); } } } }