BAZEL-2160 cleanup

GitOrigin-RevId: 7d96e5f37c28adf8651a57ebc23b295da9b4f24d
This commit is contained in:
Vladimir Krivosheev
2025-09-12 16:34:47 +00:00
committed by intellij-monorepo-bot
parent b24bd9b6b2
commit cea2e2e7be
11 changed files with 133 additions and 112 deletions
@@ -1,4 +1,6 @@
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
@file:Suppress("ReplacePutWithAssignment", "ReplaceGetOrSet")
package com.intellij.compiler
import com.intellij.openapi.components.PersistentStateComponent
@@ -22,8 +24,9 @@ internal class ExternalCompilerConfigurationStorage(private val project: Project
companion object {
@JvmStatic
fun getInstance(project: Project): ExternalCompilerConfigurationStorage =
project.getService(ExternalCompilerConfigurationStorage::class.java)
fun getInstance(project: Project): ExternalCompilerConfigurationStorage {
return project.getService(ExternalCompilerConfigurationStorage::class.java)
}
}
override fun getState(): Element {
@@ -13,13 +13,14 @@ import org.jetbrains.jps.model.java.compiler.JpsJavaCompilerOptions;
import java.util.HashMap;
import java.util.Map;
@SuppressWarnings("LightServiceMigrationCode")
@State(name = "JavacSettings", storages = @Storage("compiler.xml"))
public class JavacConfiguration implements PersistentStateComponent<JpsJavaCompilerOptions> {
public final class JavacConfiguration implements PersistentStateComponent<JpsJavaCompilerOptions> {
private final JpsJavaCompilerOptions mySettings = new JpsJavaCompilerOptions();
private final Project myProject;
private final Project project;
public JavacConfiguration(Project project) {
myProject = project;
public JavacConfiguration(@NotNull Project project) {
this.project = project;
}
@Override
@@ -27,7 +28,7 @@ public class JavacConfiguration implements PersistentStateComponent<JpsJavaCompi
final JpsJavaCompilerOptions state = new JpsJavaCompilerOptions();
XmlSerializerUtil.copyBean(mySettings, state);
state.ADDITIONAL_OPTIONS_OVERRIDE = new HashMap<>(state.ADDITIONAL_OPTIONS_OVERRIDE); // copyBean copies by reference, we need a map clone here
final PathMacroManager macros = PathMacroManager.getInstance(myProject);
final PathMacroManager macros = PathMacroManager.getInstance(project);
state.ADDITIONAL_OPTIONS_STRING = macros.collapsePathsRecursively(state.ADDITIONAL_OPTIONS_STRING);
for (Map.Entry<String, String> entry : state.ADDITIONAL_OPTIONS_OVERRIDE.entrySet()) {
entry.setValue(macros.collapsePathsRecursively(entry.getValue()));