[jps build] cleanup: simplify code using new Java API

GitOrigin-RevId: ffc2836da50cb52b5d401a9360d96720b766c77b
This commit is contained in:
Nikolay Chashnikov
2022-08-11 15:21:09 +00:00
committed by intellij-monorepo-bot
parent c37f3a4327
commit 5dbec3af62
2 changed files with 7 additions and 7 deletions
@@ -695,7 +695,7 @@ public final class IncProjectBuilder {
private static Set<BuildTarget<?>> getTargetsWithClearedOutput(CompileContext context) {
synchronized (TARGET_WITH_CLEARED_OUTPUT) {
Set<BuildTarget<?>> data = context.getUserData(TARGET_WITH_CLEARED_OUTPUT);
return data != null? Collections.unmodifiableSet(new HashSet<>(data)) : Collections.emptySet();
return data != null ? Set.copyOf(data) : Collections.emptySet();
}
}
@@ -89,12 +89,12 @@ public final class PathMacroUtil {
}
private static Map<String, String> computeGlobalPathMacrosInsideIde() {
Map<String, String> result = new HashMap<>();
result.put(APPLICATION_HOME_DIR, FileUtilRt.toSystemIndependentName(PathManager.getHomePath()));
result.put(APPLICATION_CONFIG_DIR, FileUtilRt.toSystemIndependentName(PathManager.getConfigPath()));
result.put(APPLICATION_PLUGINS_DIR, FileUtilRt.toSystemIndependentName(PathManager.getPluginsPath()));
result.put(USER_HOME_NAME, computeUserHomePath());
return Collections.unmodifiableMap(result);
return Map.of(
APPLICATION_HOME_DIR, FileUtilRt.toSystemIndependentName(PathManager.getHomePath()),
APPLICATION_CONFIG_DIR, FileUtilRt.toSystemIndependentName(PathManager.getConfigPath()),
APPLICATION_PLUGINS_DIR, FileUtilRt.toSystemIndependentName(PathManager.getPluginsPath()),
USER_HOME_NAME, computeUserHomePath()
);
}
private static @NotNull String computeUserHomePath() {