Annotate findAnnotation and IllegalPropertyDelegateAccessException with SinceKotlin(1.1)

This commit is contained in:
Alexander Udalov
2017-02-07 17:37:32 +03:00
parent 845d6526b0
commit 5987e8a47c
3 changed files with 5 additions and 2 deletions
@@ -23,6 +23,7 @@ package kotlin.reflect
*/
@kotlin.internal.LowPriorityInOverloadResolution
@Deprecated("Use 'findAnnotation' from kotlin.reflect.full package", ReplaceWith("this.findAnnotation<T>()", "kotlin.reflect.full.findAnnotation"), level = DeprecationLevel.WARNING)
@Suppress("UNCHECKED_CAST")
@SinceKotlin("1.1")
inline fun <reified T : Annotation> KAnnotatedElement.findAnnotation(): T? =
@Suppress("UNCHECKED_CAST")
annotations.firstOrNull { it is T } as T?
@@ -22,6 +22,7 @@ import kotlin.reflect.*
/**
* Returns an annotation of the given type on this element.
*/
@Suppress("UNCHECKED_CAST")
@SinceKotlin("1.1")
inline fun <reified T : Annotation> KAnnotatedElement.findAnnotation(): T? =
@Suppress("UNCHECKED_CAST")
annotations.firstOrNull { it is T } as T?
@@ -38,6 +38,7 @@ class IllegalCallableAccessException(cause: IllegalAccessException) : kotlin.ref
* @see [kotlin.reflect.KProperty2.getDelegate]
* @see [kotlin.reflect.jvm.isAccessible]
*/
@SinceKotlin("1.1")
class IllegalPropertyDelegateAccessException(cause: IllegalAccessException) : Exception(
"Cannot obtain the delegate of a non-accessible property. Use \"isAccessible = true\" to make the property accessible",
cause