From 70cd547c2696c739e02de4f7790897a92ad206a2 Mon Sep 17 00:00:00 2001 From: Kevin Bourrillion Date: Mon, 12 Dec 2022 19:10:07 -0800 Subject: [PATCH] Fix two other tests to treat both old and new JSpecify packages the same --- .../cli/common/arguments/JavaTypeEnhancementStateParser.kt | 1 + .../configuration/JvmForeignAnnotationsConfigurator.kt | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/JavaTypeEnhancementStateParser.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/JavaTypeEnhancementStateParser.kt index 6f79123b38c..a91a9b9e0f0 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/JavaTypeEnhancementStateParser.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/JavaTypeEnhancementStateParser.kt @@ -58,6 +58,7 @@ class JavaTypeEnhancementStateParser( return JavaTypeEnhancementState(jsr305Settings) { when { + it.isSubpackageOf(JSPECIFY_OLD_ANNOTATIONS_PACKAGE) -> jspecifyReportLevel it.isSubpackageOf(JSPECIFY_ANNOTATIONS_PACKAGE) -> jspecifyReportLevel it.isSubpackageOf(CHECKER_FRAMEWORK_COMPATQUAL_ANNOTATIONS_PACKAGE) -> compatqualCheckerFrameworkAnnotationsReportLevel else -> getReportLevelForAnnotation(it, nullabilityAnnotationReportLevels, kotlinVersion) diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmForeignAnnotationsConfigurator.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmForeignAnnotationsConfigurator.kt index 5f012354de0..d2eac8dcdda 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmForeignAnnotationsConfigurator.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmForeignAnnotationsConfigurator.kt @@ -60,7 +60,10 @@ open class JvmForeignAnnotationsConfigurator(testServices: TestServices) : Envir }.toMap() val configuredReportLevels = NullabilityAnnotationStatesImpl( buildMap { - directives.singleOrZeroValue(JSPECIFY_STATE)?.let { put(JSPECIFY_ANNOTATIONS_PACKAGE, it) } + directives.singleOrZeroValue(JSPECIFY_STATE)?.let { + put(JSPECIFY_OLD_ANNOTATIONS_PACKAGE, it) + put(JSPECIFY_ANNOTATIONS_PACKAGE, it) + } for ((fqname, reportLevel) in directives[ForeignAnnotationsDirectives.NULLABILITY_ANNOTATIONS]) { put(fqname, reportLevel) }