From 0764a065e8303a63daf0ccd6b3bab2a5cede6380 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Sat, 11 Jan 2020 02:32:46 +0300 Subject: [PATCH] Rewrite UnderMigration and MigrationStatus in Java to remove dependency on kotlin-stdlib. #KT-33141 --- .../src/kotlin/annotations/jvm/Annotations.kt | 34 ------------------- .../annotations/jvm/MigrationStatus.java | 17 ++++++++++ .../annotations/jvm/UnderMigration.java | 18 ++++++++++ 3 files changed, 35 insertions(+), 34 deletions(-) delete mode 100644 libraries/tools/kotlin-annotations-jvm/src/kotlin/annotations/jvm/Annotations.kt create mode 100644 libraries/tools/kotlin-annotations-jvm/src/kotlin/annotations/jvm/MigrationStatus.java create mode 100644 libraries/tools/kotlin-annotations-jvm/src/kotlin/annotations/jvm/UnderMigration.java diff --git a/libraries/tools/kotlin-annotations-jvm/src/kotlin/annotations/jvm/Annotations.kt b/libraries/tools/kotlin-annotations-jvm/src/kotlin/annotations/jvm/Annotations.kt deleted file mode 100644 index 00d67daae8d..00000000000 --- a/libraries/tools/kotlin-annotations-jvm/src/kotlin/annotations/jvm/Annotations.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package kotlin.annotations.jvm - -/** - * Contains the list of possible migration statuses. - */ -public enum class MigrationStatus { - IGNORE, - WARN, - @Deprecated("experimental feature") - STRICT -} - -/** - * This meta-annotation is intended for user nullability annotations with JSR-305 type qualifiers. Behaviour of meta-annotated - * nullability annotations can be controlled via compilation flag. - */ -@Target(AnnotationTarget.ANNOTATION_CLASS) -public annotation class UnderMigration(val status: MigrationStatus) diff --git a/libraries/tools/kotlin-annotations-jvm/src/kotlin/annotations/jvm/MigrationStatus.java b/libraries/tools/kotlin-annotations-jvm/src/kotlin/annotations/jvm/MigrationStatus.java new file mode 100644 index 00000000000..c4d4c66fb11 --- /dev/null +++ b/libraries/tools/kotlin-annotations-jvm/src/kotlin/annotations/jvm/MigrationStatus.java @@ -0,0 +1,17 @@ +/* + * Copyright 2010-2020 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 kotlin.annotations.jvm; + +/** + * Contains the list of possible migration statuses. + */ +public enum MigrationStatus { + IGNORE, + WARN, + /** @deprecated experimental feature */ + @Deprecated + STRICT; +} diff --git a/libraries/tools/kotlin-annotations-jvm/src/kotlin/annotations/jvm/UnderMigration.java b/libraries/tools/kotlin-annotations-jvm/src/kotlin/annotations/jvm/UnderMigration.java new file mode 100644 index 00000000000..44e5c11356a --- /dev/null +++ b/libraries/tools/kotlin-annotations-jvm/src/kotlin/annotations/jvm/UnderMigration.java @@ -0,0 +1,18 @@ +/* + * Copyright 2010-2020 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 kotlin.annotations.jvm; + +import java.lang.annotation.*; + +/** + * This meta-annotation is intended for user nullability annotations with JSR-305 type qualifiers. Behaviour of meta-annotated + * nullability annotations can be controlled via compilation flag. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.ANNOTATION_TYPE}) +public @interface UnderMigration { + MigrationStatus status(); +}