XmlElement () { String prefix = System.getProperty(PlatformUtils.PLATFORM_PREFIX_KEY, ""); String appInfoData = getAppInfoData(); if (AppMode.isDevServer() && appInfoData.isEmpty()) { String module = null; if (prefix.isEmpty() || prefix.equals(PlatformUtils.IDEA_PREFIX)) { module = "intellij.idea.ultimate.customization"; } else if (prefix.equals(PlatformUtils.WEB_PREFIX)) { module = "intellij.webstorm"; } if (module != null) { Path file = Paths.get(PathManager.getHomePath() + "/out/classes/production/" + module + "/idea/" + (prefix.equals("idea") ? "" : prefix) + "ApplicationInfo.xml"); try { return XmlDomReader.readXmlAsModel(Files.newInputStream(file)); } catch (NoSuchFileException ignore) { } catch (Exception e) { throw new RuntimeException("Cannot load " + file, e); } } } else { // Gateway started from another IntelliJ-based IDE; same for Qodana if (prefix.equals(PlatformUtils.GATEWAY_PREFIX) || prefix.equals(PlatformUtils.QODANA_PREFIX)) { String customAppInfo = System.getProperty("idea.application.info.value"); if (customAppInfo != null) { try { Path file = Paths.get(customAppInfo); return XmlDomReader.readXmlAsModel(Files.newInputStream(file)); } catch (Exception e) { throw new RuntimeException("Cannot load custom application info file " + customAppInfo, e); } } } // this property is used when a product is started from distribution of another product boolean forceLoadingFromResources = "true".equals(System.getProperty("intellij.platform.load.app.info.from.resources")); if (!forceLoadingFromResources && !appInfoData.isEmpty()) { return XmlDomReader.readXmlAsModel(appInfoData.getBytes(StandardCharsets.UTF_8)); } } // from sources or from another product String resource = "idea/" + (prefix.equals("idea") ? "" : prefix) + "ApplicationInfo.xml"; InputStream stream = ApplicationNamesInfo.class.getClassLoader().getResourceAsStream(resource); if (stream == null) { throw new RuntimeException("Resource not found: " + resource); } try { return XmlDomReader.readXmlAsModel(stream); } catch (Exception e) { throw new RuntimeException("Cannot load resource: " + resource, e); } }