diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/facet/KotlinLibraryValidatorCreator.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/facet/KotlinLibraryValidatorCreator.kt index b0483fe1a0d..52c71f3d373 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/facet/KotlinLibraryValidatorCreator.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/facet/KotlinLibraryValidatorCreator.kt @@ -28,6 +28,6 @@ class KotlinLibraryValidatorCreator : KotlinFacetValidatorCreator() { DelegatingLibrariesValidatorContext(editorContext), validatorsManager, "kotlin" - ) { editor.targetPlatformComboBox.selectedItemTyped!! } + ) { editor.chosenPlatform!! } } } \ No newline at end of file diff --git a/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetEditorGeneralTab.kt b/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetEditorGeneralTab.kt index 5abb64df128..4dfaebb114f 100644 --- a/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetEditorGeneralTab.kt +++ b/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetEditorGeneralTab.kt @@ -147,13 +147,13 @@ class KotlinFacetEditorGeneralTab( compilerConfigurable.reset() } - private val chosenPlatform: IdePlatform<*, *>? + val chosenPlatform: IdePlatform<*, *>? get() = targetPlatformComboBox.selectedItemTyped } inner class ArgumentConsistencyValidator : FacetEditorValidator() { override fun check(): ValidationResult { - val platform = editor.targetPlatformComboBox.selectedItemTyped ?: return ValidationResult.OK + val platform = editor.chosenPlatform ?: return ValidationResult.OK val primaryArguments = platform.createArguments().apply { editor.compilerConfigurable.applyTo( this, @@ -270,7 +270,7 @@ class KotlinFacetEditorGeneralTab( override fun isModified(): Boolean { if (editor.useProjectSettingsCheckBox.isSelected != configuration.settings.useProjectSettings) return true - if (editor.targetPlatformComboBox.selectedItemTyped != configuration.settings.platform) return true + if (editor.chosenPlatform != configuration.settings.platform) return true return !editor.useProjectSettingsCheckBox.isSelected && editor.compilerConfigurable.isModified } @@ -288,7 +288,7 @@ class KotlinFacetEditorGeneralTab( editor.compilerConfigurable.apply() with(configuration.settings) { useProjectSettings = editor.useProjectSettingsCheckBox.isSelected - editor.targetPlatformComboBox.selectedItemTyped?.let { + editor.chosenPlatform?.let { if (it != platform) { val platformArguments = when { it.isJvm -> editor.compilerConfigurable.k2jvmCompilerArguments