KT-7135 Java to Kotlin converter should update usages in Java and Koltin code in the rest of the project

#KT-7135 Fixed
This commit is contained in:
Valentin Kipyatkov
2015-04-07 13:06:31 +03:00
parent b810ebbb0e
commit 1afbb961ee
50 changed files with 962 additions and 156 deletions
@@ -0,0 +1,14 @@
package test;
class ClassWithStatics {
public void instanceMethod(){}
public static void staticMethod(int p) {}
public static final int staticField = 1;
protected static int ourValue = 0;
public static int getValue() { return ourValue; }
public static void setValue(int value) { ourValue = value; }
}
@@ -0,0 +1,16 @@
package test
open class ClassWithStatics {
public fun instanceMethod() {
}
companion object {
public fun staticMethod(p: Int) {
}
public val staticField: Int = 1
public var value: Int = 0
}
}
@@ -0,0 +1,16 @@
package test;
class C {
void foo(ClassWithStatics c) {
ClassWithStatics.staticMethod(ClassWithStatics.staticField);
c.instanceMethod();
ClassWithStatics.staticField += 2;
}
}
class D extends ClassWithStatics {
void foo() {
staticMethod(staticField);
ourValue *= 2;
}
}
@@ -0,0 +1,16 @@
package test;
class C {
void foo(ClassWithStatics c) {
ClassWithStatics.Companion.staticMethod(ClassWithStatics.staticField);
c.instanceMethod();
ClassWithStatics.staticField += 2;
}
}
class D extends ClassWithStatics {
void foo() {
Companion.staticMethod(staticField);
value *= 2;
}
}
@@ -0,0 +1,5 @@
package test
fun foo() {
ClassWithStatics.staticMethod(ClassWithStatics.staticField)
}
@@ -0,0 +1,5 @@
package test
fun foo() {
ClassWithStatics.staticMethod(ClassWithStatics.staticField)
}