Remove unnecessary experiment flag for Java language level
@@ -20,23 +20,17 @@ import com.google.idea.blaze.base.model.BlazeProjectData;
import com.google.idea.blaze.base.projectview.ProjectViewSet;
import com.google.idea.blaze.java.projectview.JavaLanguageLevelSection;
import com.google.idea.blaze.java.sync.model.BlazeJavaSyncData;
-import com.google.idea.common.experiments.BoolExperiment;
import com.intellij.pom.java.LanguageLevel;
import javax.annotation.Nullable;
/** Called by sync plugins to determine the appropriate java language level. */
public class JavaLanguageLevelHelper {
- // We need to flexibly switch to Java 11 as default language level at some point in the future.
- // Afterwards, we can remove this flag again.
- private static final BoolExperiment useJava11ForDefaultLanguageLevel =
- new BoolExperiment("java.defaultLanguageLevel.java11.enabled", true);
-
public static LanguageLevel getJavaLanguageLevel(
ProjectViewSet projectViewSet, BlazeProjectData blazeProjectData) {
LanguageLevel fromToolchain = getLanguageLevelFromToolchain(blazeProjectData);
return JavaLanguageLevelSection.getLanguageLevel(
- projectViewSet, fromToolchain != null ? fromToolchain : getDefaultLanguageLevel());
+ projectViewSet, fromToolchain != null ? fromToolchain : LanguageLevel.JDK_11);
}
@Nullable
@@ -48,10 +42,4 @@ public class JavaLanguageLevelHelper {
String sourceVersion = javaSyncData.getImportResult().sourceVersion;
return Strings.isNullOrEmpty(sourceVersion) ? null : LanguageLevel.parse(sourceVersion);
}
-
- private static LanguageLevel getDefaultLanguageLevel() {
- return useJava11ForDefaultLanguageLevel.getValue()
- ? LanguageLevel.JDK_11
- : LanguageLevel.JDK_1_8;
- }
}
