From 572ec19c55864c8099106ab7bd12235069af4032 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 22 Sep 2017 16:28:12 +0200 Subject: [PATCH] SuppressNotificationState: J2K --- .../versions/SuppressNotificationState.kt | 28 ++++++++----------- ...rtedAbiVersionNotificationPanelProvider.kt | 2 +- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/versions/SuppressNotificationState.kt b/idea/src/org/jetbrains/kotlin/idea/versions/SuppressNotificationState.kt index 0fabbbfe030..1fa44c5b1d1 100644 --- a/idea/src/org/jetbrains/kotlin/idea/versions/SuppressNotificationState.kt +++ b/idea/src/org/jetbrains/kotlin/idea/versions/SuppressNotificationState.kt @@ -14,25 +14,21 @@ * limitations under the License. */ -package org.jetbrains.kotlin.idea.versions; +package org.jetbrains.kotlin.idea.versions -import com.intellij.openapi.components.PersistentStateComponent; -import com.intellij.openapi.components.State; -import com.intellij.openapi.components.Storage; -import com.intellij.openapi.components.StoragePathMacros; -import com.intellij.util.xmlb.XmlSerializerUtil; +import com.intellij.openapi.components.PersistentStateComponent +import com.intellij.openapi.components.State +import com.intellij.openapi.components.Storage +import com.intellij.openapi.components.StoragePathMacros +import com.intellij.util.xmlb.XmlSerializerUtil -@State(name = "SuppressABINotification", storages = {@Storage(file = StoragePathMacros.PROJECT_FILE)}) -public class SuppressNotificationState implements PersistentStateComponent { - public boolean isSuppressed; +@State(name = "SuppressABINotification", storages = arrayOf(Storage(file = StoragePathMacros.PROJECT_FILE))) +class SuppressNotificationState : PersistentStateComponent { + var isSuppressed: Boolean = false - @Override - public SuppressNotificationState getState() { - return this; - } + override fun getState(): SuppressNotificationState = this - @Override - public void loadState(SuppressNotificationState state) { - XmlSerializerUtil.copyBean(state, this); + override fun loadState(state: SuppressNotificationState) { + XmlSerializerUtil.copyBean(state, this) } } diff --git a/idea/src/org/jetbrains/kotlin/idea/versions/UnsupportedAbiVersionNotificationPanelProvider.kt b/idea/src/org/jetbrains/kotlin/idea/versions/UnsupportedAbiVersionNotificationPanelProvider.kt index 4cd62634f77..7bf214d0e93 100644 --- a/idea/src/org/jetbrains/kotlin/idea/versions/UnsupportedAbiVersionNotificationPanelProvider.kt +++ b/idea/src/org/jetbrains/kotlin/idea/versions/UnsupportedAbiVersionNotificationPanelProvider.kt @@ -231,7 +231,7 @@ class UnsupportedAbiVersionNotificationPanelProvider(private val project: Projec fun checkAndCreate(module: Module): EditorNotificationPanel? { val state = ServiceManager.getService(project, SuppressNotificationState::class.java).state - if (state != null && state.isSuppressed) { + if (state.isSuppressed) { return null }