Deprecate JVM platform annotations in favor of capitilized themselves

This commit is contained in:
Denis Zharkov
2015-09-04 14:46:46 +03:00
parent 5471a1d18a
commit 952d45dc8b
107 changed files with 290 additions and 266 deletions
@@ -58,7 +58,7 @@ public class JavaToKotlinPreconversionPullUpHelper(
private val fieldsToUsages = HashMap<PsiField, List<EncapsulateFieldUsageInfo>>()
private val dummyAccessorByName = HashMap<String, PsiMethod>()
private val jvmStaticAnnotation = JetPsiFactory(data.sourceClass.project).createAnnotationEntry("kotlin.jvm.jvmStatic")
private val jvmStaticAnnotation = JetPsiFactory(data.sourceClass.project).createAnnotationEntry("kotlin.jvm.JvmStatic")
companion object {
private var PsiMember.originalMember: PsiMember? by CopyableUserDataProperty(Key.create("ORIGINAL_MEMBER"))
+13 -13
View File
@@ -1,57 +1,57 @@
import kotlin.jvm.jvmStatic
import kotlin.jvm.JvmStatic
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'class'">jvmStatic</error>
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'class'">JvmStatic</error>
class A {
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'object'">jvmStatic</error>
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'object'">JvmStatic</error>
companion object {
jvmStatic fun a1() {
JvmStatic fun a1() {
}
}
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'object'">jvmStatic</error>
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'object'">JvmStatic</error>
object A {
jvmStatic fun a2() {
JvmStatic fun a2() {
}
}
fun test() {
val <warning descr="[UNUSED_VARIABLE] Variable 's' is never used">s</warning> = object {
<error descr="[JVM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'jvmStatic'">jvmStatic fun a3()</error> {
<error descr="[JVM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'JvmStatic'">JvmStatic fun a3()</error> {
}
}
}
<error descr="[JVM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'jvmStatic'">jvmStatic fun a4()</error> {
<error descr="[JVM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'JvmStatic'">JvmStatic fun a4()</error> {
}
}
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'interface'">jvmStatic</error>
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'interface'">JvmStatic</error>
interface B {
companion object {
<error descr="[JVM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'jvmStatic'">jvmStatic fun a1()</error> {
<error descr="[JVM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'JvmStatic'">JvmStatic fun a1()</error> {
}
}
object A {
jvmStatic fun a2() {
JvmStatic fun a2() {
}
}
fun test() {
val <warning descr="[UNUSED_VARIABLE] Variable 's' is never used">s</warning> = object {
<error descr="[JVM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'jvmStatic'">jvmStatic fun a3()</error> {
<error descr="[JVM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'JvmStatic'">JvmStatic fun a3()</error> {
}
}
}
<error descr="[JVM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'jvmStatic'">jvmStatic fun a4()</error> {
<error descr="[JVM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'JvmStatic'">JvmStatic fun a4()</error> {
}
}
@@ -5,7 +5,7 @@ class C {
}
companion object {
jvmStatic public fun main(args: Array<String>) {
JvmStatic public fun main(args: Array<String>) {
}
}
}
@@ -1,7 +1,7 @@
package to
public object JavaClass {
jvmStatic public fun main(args: Array<String>) {
JvmStatic public fun main(args: Array<String>) {
println("Hello, world!")
}
}
@@ -21,7 +21,7 @@ abstract class A {
var X = "1" + "2"
// INFO: {"checked": "true"}
jvmStatic fun foo2(n: Int): String {
JvmStatic fun foo2(n: Int): String {
return "_" + n + "_"
}
}
@@ -19,7 +19,7 @@ abstract class A {
var X = "1" + "2"
// INFO: {"checked": "true", "toAbstract": "true"}
jvmStatic fun foo2(n: Int): String {
JvmStatic fun foo2(n: Int): String {
return "_" + n + "_"
}
}
@@ -15,7 +15,7 @@ interface A {
var X = "1" + "2"
// INFO: {"checked": "true"}
jvmStatic fun foo2(n: Int): String {
JvmStatic fun foo2(n: Int): String {
return "_" + n + "_"
}
}
@@ -23,7 +23,7 @@ class T {
var X = "1" + "2"
// INFO: {"checked": "true"}
jvmStatic fun foo2(n: Int): String {
JvmStatic fun foo2(n: Int): String {
return "_" + n + "_"
}
}
@@ -2,6 +2,6 @@ package testing.rename
public open class C {
companion object {
jvmStatic fun second() {}
JvmStatic fun second() {}
}
}
@@ -2,6 +2,6 @@ package testing.rename
public open class C {
companion object {
jvmStatic fun first() {}
JvmStatic fun first() {}
}
}