Rename Jsr305State -> JavaTypeEnhancementState

Also, rename some of the properties
It's needed to store status for codeanalysis annotation in that class
This commit is contained in:
Denis Zharkov
2019-08-14 12:54:55 +03:00
committed by Victor Petukhov
parent 2f04a1505d
commit 6c37574fce
22 changed files with 109 additions and 95 deletions
@@ -5,7 +5,7 @@
package org.jetbrains.kotlin.config
import org.jetbrains.kotlin.utils.Jsr305State
import org.jetbrains.kotlin.utils.JavaTypeEnhancementState
import kotlin.reflect.KProperty
object JvmAnalysisFlags {
@@ -35,8 +35,8 @@ object JvmAnalysisFlags {
private object Delegates {
object Jsr305StateWarnByDefault {
operator fun provideDelegate(instance: Any?, property: KProperty<*>): AnalysisFlag.Delegate<Jsr305State> =
AnalysisFlag.Delegate(property.name, Jsr305State.DEFAULT)
operator fun provideDelegate(instance: Any?, property: KProperty<*>): AnalysisFlag.Delegate<JavaTypeEnhancementState> =
AnalysisFlag.Delegate(property.name, JavaTypeEnhancementState.DEFAULT)
}
object JvmDefaultModeDisabledByDefault {
@@ -1,31 +0,0 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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.config
enum class JvmDefaultMode(val description: String) {
DISABLE("disable"),
ENABLE("enable"),
ENABLE_WITH_DEFAULT_IMPLS("compatibility"),
ALL_COMPATIBILITY("all-compatibility"),
ALL_INCOMPATIBLE("all");
val isEnabled
get() = this != DISABLE
val isCompatibility
get() = this == ENABLE_WITH_DEFAULT_IMPLS || this == ALL_COMPATIBILITY
val forAllMethodsWithBody
get() = this == ALL_COMPATIBILITY || this == ALL_INCOMPATIBLE
companion object {
@JvmField
val DEFAULT = DISABLE
@JvmStatic
fun fromStringOrNull(string: String?) = values().find { it.description == string }
}
}