From 72e08dc18dffcd6d85c096cb922c55b3b2247423 Mon Sep 17 00:00:00 2001 From: Ilya Muradyan Date: Tue, 29 Aug 2023 16:18:49 +0200 Subject: [PATCH] [Roots UI, minor] Use @JvmOverloads instead of secondary constructor GitOrigin-RevId: e5cc87716a5ad1a6717e308ad32833f5cf72de6b --- .../openapi/roots/ui/configuration/LanguageLevelCombo.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/LanguageLevelCombo.kt b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/LanguageLevelCombo.kt index 61992f6194ee..6f6be7196113 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/LanguageLevelCombo.kt +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/LanguageLevelCombo.kt @@ -17,14 +17,12 @@ import org.jetbrains.annotations.Nls import org.jetbrains.annotations.NonNls import javax.swing.DefaultComboBoxModel -abstract class LanguageLevelCombo( +abstract class LanguageLevelCombo @JvmOverloads constructor( defaultItem: @Nls String?, // It could be an open method but since we use it in constructor we have a leaking this problem - levelFilter: (LanguageLevel) -> Boolean + levelFilter: (LanguageLevel) -> Boolean = {true} ) : ComboBox() { - constructor(defaultItem: @Nls String?): this(defaultItem, {true}) - init { val items = mutableListOf() items.add(defaultItem ?: "")