Introduce jdk-api-validator to ensure kotlin-reflect uses jdk6 API

Merge-request: KT-MR-6930
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
This commit is contained in:
Abduqodiri Qurbonzoda
2023-07-12 05:13:08 +00:00
committed by Space Team
parent 5424c54fae
commit 7346cf4777
13 changed files with 285 additions and 2 deletions
@@ -0,0 +1,15 @@
/*
* Copyright 2010-2023 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
/**
* Suppresses verification errors of the jdk-api-validator tool for certain scope.
* Such scopes include references to Java 8 API that are not available in Android API,
* but can be desugared by R8 or their execution is prevented on Android platform.
*/
@Retention(AnnotationRetention.BINARY)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
internal annotation class SuppressJdk6SignatureCheck
@@ -647,6 +647,7 @@ public class LockBasedStorageManager implements StorageManager {
);
}
@org.jetbrains.kotlin.SuppressJdk6SignatureCheck
private AssertionError unableToRemoveKey(K input, Throwable throwable) {
return sanitizeStackTrace(
new AssertionError("Unable to remove "