[Cleanup] Remove old project model compat method from Kotlin Sync plugin
@@ -38,7 +38,6 @@ import com.google.idea.blaze.base.sync.libraries.LibrarySource;
import com.google.idea.blaze.java.sync.JavaLanguageLevelHelper;
import com.google.idea.common.experiments.BoolExperiment;
import com.google.idea.sdkcompat.kotlin.KotlinCompat;
-import com.google.idea.sdkcompat.kotlin.KotlinLibraryConfiguratorForOldProjectModel;
import com.intellij.facet.FacetManager;
import com.intellij.facet.ModifiableFacetModel;
import com.intellij.openapi.application.ReadAction;
@@ -46,7 +45,6 @@ import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModifiableRootModel;
-import com.intellij.openapi.util.registry.Registry;
import com.intellij.pom.java.LanguageLevel;
import java.util.Arrays;
import java.util.Collection;
@@ -77,8 +75,6 @@ public class BlazeKotlinSyncPlugin implements BlazeSyncPlugin {
private static final LanguageVersion DEFAULT_VERSION = LanguageVersion.KOTLIN_1_2;
private static final BoolExperiment setCompilerFlagsExperiment =
new BoolExperiment("blaze.kotlin.sync.set.compiler.flags", true);
- private static final BoolExperiment earlyKotlinLibraryAdditionEnabled =
- new BoolExperiment("blaze.kotlin.sync.add.library.early.enable", true);
@Override
public Set<LanguageClass> getSupportedLanguagesInWorkspace(WorkspaceType workspaceType) {
@@ -237,19 +233,6 @@ public class BlazeKotlinSyncPlugin implements BlazeSyncPlugin {
setJavaLanguageLevel(
kotlinFacet,
JavaLanguageLevelHelper.getJavaLanguageLevel(projectViewSet, blazeProjectData));
-
- // #api203
- // b/198439707: When the old project model is in use, get ModifiableModel for a module may lead
- // to thousands of root change events if it has thousands of jars attached. In order to
- // avoid this, we attach kotlin library to ModifiableModel before it's committed. So
- // KotlinLibraryConfigurator.configureModule does not need to attach kotlin library to module
- // and it avoids potential conversion.
- if (earlyKotlinLibraryAdditionEnabled.getValue()
- && (Registry.is("ide.old.project.model", false)
- || !Registry.is("ide.new.project.model", true))) {
- KotlinLibraryConfiguratorForOldProjectModel.INSTANCE.configureModel(
- project, workspaceModifiableModel, workspaceModule);
- }
}
/**
