annotation() now has no arguments. Syntax migration to Retention / Repeatable / MustBeDocumented combination

Deprecated test for annotation(params) completion deleted. A lot of tests changed.
This commit is contained in:
Mikhail Glukhikh
2015-09-03 18:34:48 +03:00
committed by Mikhail Glukhikh
parent 86f35acf9e
commit eab288bdd7
99 changed files with 300 additions and 187 deletions
@@ -23,14 +23,18 @@ import kotlin.annotation.AnnotationTarget.*
* are immediately made visible to other threads.
*/
target(FIELD)
public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class Volatile
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
public annotation class Volatile
/**
* Marks the JVM backing field of the annotated property as `transient`, meaning that it is not
* part of the default serialized form of the object.
*/
target(FIELD)
public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class Transient
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
public annotation class Transient
/**
* Marks the JVM method generated from the annotated function as `strictfp`, meaning that the precision
@@ -38,7 +42,9 @@ public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = tru
* achieve better portability.
*/
target(FUNCTION, CONSTRUCTOR, PROPERTY_GETTER, PROPERTY_SETTER, CLASSIFIER)
public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class Strictfp
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
public annotation class Strictfp
/**
* Marks the JVM method generated from the annotated function as `synchronized`, meaning that the method
@@ -46,12 +52,16 @@ public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = tru
* for static methods, the class) on which the method is defined.
*/
target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class Synchronized
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
public annotation class Synchronized
/**
* Marks the JVM method generated from the annotated function as `native`, meaning that it's not implemented
* in Java but rather in a different language (for example, in C/C++ using JNI).
*/
target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
@deprecated("Use kotlin.external instead", ReplaceWith("kotlin.external"))
public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class native
public annotation class native
@@ -23,7 +23,9 @@ package kotlin.jvm
* takes N-1 parameters (all but the last one that takes a default value), the second takes N-2 parameters, and so on.
*/
target(AnnotationTarget.FUNCTION, AnnotationTarget.CONSTRUCTOR)
public annotation(retention = AnnotationRetention.BINARY, mustBeDocumented = true) class JvmOverloads
@Retention(AnnotationRetention.BINARY)
@MustBeDocumented
public annotation class JvmOverloads
/**
@@ -32,7 +34,9 @@ public annotation(retention = AnnotationRetention.BINARY, mustBeDocumented = tru
* for more information.
*/
target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class JvmStatic
@Retention(AnnotationRetention.RUNTIME)
@MustBeDocumented
public annotation class JvmStatic
/**
* Specifies the name for the Java class or method
@@ -42,10 +46,14 @@ public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = tr
* @property name the name of the element.
*/
target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class JvmName(public val name: String)
@Retention(AnnotationRetention.RUNTIME)
@MustBeDocumented
public annotation class JvmName(public val name: String)
/**
* Instructs the Kotlin compiler to generate a public backing field for this property.
*/
target(AnnotationTarget.FIELD)
public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class publicField
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
public annotation class publicField
@@ -19,9 +19,13 @@ package kotlin.platform
import kotlin.annotation.AnnotationTarget.*
target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
deprecated("Use kotlin.jvm.JvmName instead", ReplaceWith("kotlin.jvm.JvmName"))
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class platformName(public val name: String)
@Retention(AnnotationRetention.RUNTIME)
@MustBeDocumented
@deprecated("Use kotlin.jvm.JvmName instead", ReplaceWith("kotlin.jvm.JvmName"))
public annotation class platformName(public val name: String)
target(FUNCTION, PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER)
deprecated("Use kotlin.jvm.JvmStatic instead", ReplaceWith("kotlin.jvm.JvmStatic"))
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class platformStatic
@Retention(AnnotationRetention.RUNTIME)
@MustBeDocumented
@deprecated("Use kotlin.jvm.JvmStatic instead", ReplaceWith("kotlin.jvm.JvmStatic"))
public annotation class platformStatic
+2 -1
View File
@@ -22,7 +22,8 @@ import kotlin.reflect.KClass
*
* @property exceptionClasses the list of checked exception classes that may be thrown by the function.
*/
public annotation(retention = AnnotationRetention.SOURCE) class Throws(public vararg val exceptionClasses: KClass<out Throwable>)
@Retention(AnnotationRetention.SOURCE)
public annotation class Throws(public vararg val exceptionClasses: KClass<out Throwable>)
/**
* Returns the runtime Java class of this object.