Drop deprecations: reflection utilites.

This commit is contained in:
Ilya Gorbunov
2016-01-16 18:43:38 +03:00
parent 69f884dcd3
commit 9142025df6
2 changed files with 0 additions and 79 deletions
@@ -1,29 +0,0 @@
/*
* Copyright 2010-2015 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.
*/
@file:kotlin.jvm.JvmName("ClassMapping")
@file:Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN")
package kotlin.jvm
import kotlin.jvm.internal.Reflection
import kotlin.reflect.KClass
@Deprecated("Use 'java' extension property instead.", ReplaceWith("this.java"), level = DeprecationLevel.ERROR)
public fun <T: Any> KClass<T>.getJava(): Class<T> = this.java
@Deprecated("Use 'kotlin' extension property instead.", ReplaceWith("this.kotlin"), level = DeprecationLevel.ERROR)
public fun <T : Any> Class<T>.getKotlin(): KClass<T> = Reflection.createKotlinClass(this) as KClass<T>
@@ -1,50 +0,0 @@
@file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("ExtensionsKt")
package kotlin
import java.lang.reflect.Method
import kotlin.reflect.KClass
/**
* This annotation indicates what exceptions should be declared by a function when compiled to a JVM method.
*
* Example:
*
* ```
* throws(IOException::class)
* fun readFile(name: String): String {...}
* ```
*
* will be translated to
*
* ```
* String readFile(String name) throws IOException {...}
* ```
*
* @property exceptionClasses the list of checked exception classes that may be thrown by the function.
*/
@Retention(AnnotationRetention.SOURCE)
@Deprecated("Use 'kotlin.jvm.Throws' instead", ReplaceWith("kotlin.jvm.Throws"), DeprecationLevel.ERROR)
public annotation class throws(public vararg val exceptionClasses: KClass<out Throwable>)
/**
* Returns the Java class for the specified type.
*/
@Suppress("REIFIED_TYPE_PARAMETER_NO_INLINE")
@Deprecated("Use the class reference and .java extension property instead: MyClass::class.java", ReplaceWith("T::class.java"))
public fun <reified T: Any> javaClass(): Class<T> = T::class.java
/**
* Returns the annotation type of this annotation.
*/
@Deprecated("Use annotationClass.java instead", ReplaceWith("annotationClass.java"))
public fun <T : Annotation> T.annotationType() : Class<out T> = annotationClass.java
/**
* Invokes the underlying method represented by this [Method] object, on the specified [instance] with the specified parameters.
*/
@Suppress("NOTHING_TO_INLINE")
public inline operator fun Method.invoke(instance: Any, vararg args: Any?): Any? {
return invoke(instance, *args)
}