Fix two other tests to treat both old and new JSpecify packages the same

This commit is contained in:
Kevin Bourrillion
2022-12-12 19:10:07 -08:00
committed by Space Team
parent 503e093af3
commit 70cd547c26
2 changed files with 5 additions and 1 deletions
@@ -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)
@@ -60,7 +60,10 @@ open class JvmForeignAnnotationsConfigurator(testServices: TestServices) : Envir
}.toMap()
val configuredReportLevels = NullabilityAnnotationStatesImpl(
buildMap<FqName, ReportLevel> {
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)
}