New J2K: add multi-file conversion tests from old j2k
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package test;
|
||||
|
||||
class ClassWithStatics {
|
||||
public void instanceMethod() {
|
||||
}
|
||||
|
||||
public static void staticMethod(int p) {
|
||||
}
|
||||
|
||||
public static final int staticField = 1;
|
||||
public static int staticNonFinalField = 1;
|
||||
|
||||
protected static int ourValue = 0;
|
||||
|
||||
public static int getValue() {
|
||||
return ourValue;
|
||||
}
|
||||
|
||||
public static void setValue(int value) {
|
||||
ourValue = value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package test
|
||||
|
||||
internal open class ClassWithStatics {
|
||||
fun instanceMethod() {}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun staticMethod(p: Int) {}
|
||||
const val staticField = 1
|
||||
@JvmField
|
||||
var staticNonFinalField = 1
|
||||
var value = 0
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package test;
|
||||
|
||||
class C {
|
||||
void foo(ClassWithStatics c) {
|
||||
ClassWithStatics.staticMethod(ClassWithStatics.staticField);
|
||||
c.instanceMethod();
|
||||
ClassWithStatics.staticNonFinalField += 2;
|
||||
}
|
||||
|
||||
void methodReferences() {
|
||||
Object staticMethod = ClassWithStatics::staticMethod;
|
||||
Object instanceMethod = ClassWithStatics::instanceMethod;
|
||||
}
|
||||
}
|
||||
|
||||
class D extends ClassWithStatics {
|
||||
void foo() {
|
||||
staticMethod(staticField);
|
||||
ourValue *= 2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package test;
|
||||
|
||||
class C {
|
||||
void foo(ClassWithStatics c) {
|
||||
ClassWithStatics.staticMethod(ClassWithStatics.staticField);
|
||||
c.instanceMethod();
|
||||
ClassWithStatics.staticNonFinalField += 2;
|
||||
}
|
||||
|
||||
void methodReferences() {
|
||||
Object staticMethod = ClassWithStatics::staticMethod;
|
||||
Object instanceMethod = ClassWithStatics::instanceMethod;
|
||||
}
|
||||
}
|
||||
|
||||
class D extends ClassWithStatics {
|
||||
void foo() {
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user