IJPL-15953 make LanguageLevelProjectExtension.{getDefault and setDefault} abstract

to ease migration to the workspace model: it is convenient when the LanguageLevelProjectExtensionImpl state (LanguageLevel + isDefault) is stored in one single place (in contrast to being distributed through the class hierarchy).

GitOrigin-RevId: b2ff3c4b0e55b4b9b53a8eb45981507527825c34
This commit is contained in:
Andrei.Kuznetsov
2025-08-11 09:17:19 +00:00
committed by intellij-monorepo-bot
parent 1a7a0eefd9
commit 93d4213af7
3 changed files with 28 additions and 10 deletions
@@ -26,22 +26,17 @@ public abstract class LanguageLevelProjectExtension {
public abstract void setLanguageLevel(@NotNull LanguageLevel languageLevel);
private Boolean myDefault;
/**
* Auto-detect language level from project JDK maximum possible level.
* @return null if the property is not set yet (e.g. after migration).
*/
public @Nullable Boolean getDefault() {
return myDefault;
}
public abstract @Nullable Boolean getDefault();
public void setDefault(@Nullable Boolean value) {
myDefault = value;
}
public abstract void setDefault(@Nullable Boolean value);
public boolean isDefault() {
return myDefault != null && myDefault;
Boolean currentValue = getDefault();
return currentValue != null && currentValue;
}
public void languageLevelsChanged() {