From a29d693dc52471dbdb506823afb6829743fbca38 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 9 Mar 2018 12:02:56 +0100 Subject: [PATCH] Fix inverted logic of isNotConfiguredNotificationRequired --- .../ConfigureKotlinInProjectUtils.kt | 6 +++--- .../ConfigureKotlinNotificationManager.kt | 17 +++-------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInProjectUtils.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInProjectUtils.kt index 008d24238a5..72c0ced62bb 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInProjectUtils.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInProjectUtils.kt @@ -115,7 +115,7 @@ fun getConfigurableModulesWithKotlinFiles(project: Project): List = emptyList()) { val notificationString = DumbService.getInstance(project).runReadActionInSmartMode(Computable { val modules = getConfigurableModulesWithKotlinFiles(project).exclude(excludeModules) - if (modules.all(::isNotConfiguredNotificationRequired)) + if (modules.none(::isNotConfiguredNotificationRequired)) null else ConfigureKotlinNotification.getNotificationString(project, excludeModules) @@ -137,7 +137,7 @@ fun showConfigureKotlinNotificationIfNeeded(project: Project, excludeModules: Li } fun isNotConfiguredNotificationRequired(moduleGroup: ModuleSourceRootGroup): Boolean { - return !SuppressNotificationState.isKotlinNotConfiguredSuppressed(moduleGroup) && isModuleConfigured(moduleGroup) + return !SuppressNotificationState.isKotlinNotConfiguredSuppressed(moduleGroup) && !isModuleConfigured(moduleGroup) } fun getAbleToRunConfigurators(project: Project): Collection { diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinNotificationManager.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinNotificationManager.kt index 8dbc8488851..61ca5e29c0c 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinNotificationManager.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinNotificationManager.kt @@ -1,17 +1,6 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.idea.configuration @@ -76,7 +65,7 @@ fun checkHideNonConfiguredNotifications(project: Project) { if (!checkInProgress.compareAndSet(false, true)) return@executeOnPooledThread DumbService.getInstance(project).waitForSmartMode() - if (getConfigurableModulesWithKotlinFiles(project).all(::isNotConfiguredNotificationRequired)) { + if (getConfigurableModulesWithKotlinFiles(project).none(::isNotConfiguredNotificationRequired)) { ApplicationManager.getApplication().invokeLater { ConfigureKotlinNotificationManager.expireOldNotifications(project) checkInProgress.set(false)