Source:
<code>private static void initializeAppsLocation(Log log, File serverXML, File configDir, File bootstrapFile, Map<String, String> bootstrapProp, File serverEnvFile) { try { ServerConfigDocument.log = log; serverXMLFile = serverXML; configDirectory = configDir; locations = new HashSet<String>(); props = new Properties(); Document doc = parseDocument(new FileInputStream(serverXMLFile)); Properties fProps; File cfgDirFile = getFileFromConfigDirectory("server.env"); if (cfgDirFile != null) { fProps = parseProperties(new FileInputStream(cfgDirFile)); props.putAll(fProps); } else if (serverEnvFile.exists()) { fProps = parseProperties(new FileInputStream(serverEnvFile)); props.putAll(fProps); } cfgDirFile = getFileFromConfigDirectory("bootstrap.properties"); if (cfgDirFile != null) { fProps = parseProperties(new FileInputStream(cfgDirFile)); props.putAll(fProps); } else if (bootstrapProp != null && !bootstrapProp.isEmpty()) { <START> Map.Entry<String,String> entry=bootstrapProp.entrySet().iterator().next(); <END> while (bootstrapProp.values().remove(null)) ; props.putAll(bootstrapProp); } else if (bootstrapFile.exists()) { fProps = parseProperties(new FileInputStream(bootstrapFile)); props.putAll(fProps); } parseIncludeVariables(doc); parseConfigDropinsDirVariables("defaults"); parseVariables(doc); parseConfigDropinsDirVariables("overrides"); parseApplication(doc, XPATH_SERVER_APPLICATION); parseApplication(doc, XPATH_SERVER_WEB_APPLICATION); parseApplication(doc, XPATH_SERVER_ENTERPRISE_APPLICATION); parseInclude(doc); parseConfigDropinsDir(); } catch (Exception e) { e.printStackTrace(); } }</code><technical_language>This file update needs removed longer it. This is codacy is complaining too</technical_language>

Target:
private static void initializeAppsLocation(Log log, File serverXML, File configDir, File bootstrapFile, Map<String, String> bootstrapProp, File serverEnvFile) { try { ServerConfigDocument.log = log; serverXMLFile = serverXML; configDirectory = configDir; locations = new HashSet<String>(); props = new Properties(); Document doc = parseDocument(new FileInputStream(serverXMLFile)); Properties fProps; File cfgDirFile = getFileFromConfigDirectory("server.env"); if (cfgDirFile != null) { fProps = parseProperties(new FileInputStream(cfgDirFile)); props.putAll(fProps); } else if (serverEnvFile.exists()) { fProps = parseProperties(new FileInputStream(serverEnvFile)); props.putAll(fProps); } cfgDirFile = getFileFromConfigDirectory("bootstrap.properties"); if (cfgDirFile != null) { fProps = parseProperties(new FileInputStream(cfgDirFile)); props.putAll(fProps); } else if (bootstrapProp != null && !bootstrapProp.isEmpty()) { while (bootstrapProp.values().remove(null)) ; props.putAll(bootstrapProp); } else if (bootstrapFile.exists()) { fProps = parseProperties(new FileInputStream(bootstrapFile)); props.putAll(fProps); } parseIncludeVariables(doc); parseConfigDropinsDirVariables("defaults"); parseVariables(doc); parseConfigDropinsDirVariables("overrides"); parseApplication(doc, XPATH_SERVER_APPLICATION); parseApplication(doc, XPATH_SERVER_WEB_APPLICATION); parseApplication(doc, XPATH_SERVER_ENTERPRISE_APPLICATION); parseInclude(doc); parseConfigDropinsDir(); } catch (Exception e) { e.printStackTrace(); } }