New J2K: Fix existing test data

This commit is contained in:
Ilya Kirillov
2019-04-10 15:55:37 +03:00
parent ae3920d535
commit c7e08f9e5d
36 changed files with 620 additions and 622 deletions
@@ -1 +1 @@
val a: Array<Double?> = arrayOf(1.0, 2.0, 3.0)
val a = arrayOf(1.0, 2.0, 3.0)
@@ -1 +1 @@
val a: Array<Float?> = arrayOf(1.0f, 2f, 3f)
val a = arrayOf(1.0f, 2f, 3f)
@@ -1 +1 @@
val d2: Array<IntArray?> = arrayOf()
val d2: Array<IntArray> = arrayOf()
+1 -1
View File
@@ -1 +1 @@
val a: Array<String?> = arrayOf("abc")
val a = arrayOf("abc")
@@ -1 +1 @@
5 shl 16 or (0 shr 8 or 1)
5 shl 16 or (0 shr 8) or 1
@@ -1 +1 @@
5 /*operand '5'*/ shl /*left shift*/ 16 /*operand '16'*/ or ( /*or*/ 1 /*operand '1'*/ shr /*right shift*/ 8 /*operand '8'*/ or /*or*/ 0) /*operand '0'*/ /*post comment*/
5 /*operand '5'*/ shl /*left shift*/ 16 /*operand '16'*/ or (/*or*/ 1 /*operand '1'*/ shr /*right shift*/ 8 /*operand '8'*/) or /*or*/ 0 /*operand '0'*/ /*post comment*/
+1 -1
View File
@@ -11,7 +11,7 @@ class Short(s: String?) {
internal object Test {
fun test() {
Short.valueOf("1")
test.Short.valueOf("1")
Short.valueOf("1")
java.lang.Short.valueOf("1")
}
}
+1 -1
View File
@@ -1 +1 @@
val constrArgTypes: Array<Class<*>?> = arrayOf(Array<String>::class.java, String::class.java, Int::class.java, Double::class.java)
val constrArgTypes: Array<Class<*>> = arrayOf(Array<String>::class.java, String::class.java, Int::class.java, Double::class.java)
@@ -1,6 +1,6 @@
internal class C(private val p1: Int /* parameter p1 */ // field p1
,
internal class C(private val p1 // field p1
: Int /* parameter p1 */,
/**
* Field myP2
*/
private val myP2: Int, /* Field p3 */ var p3: Int)
private val myP2: Int, /* Field p3 */ var p3: Int)
@@ -6,4 +6,4 @@ internal open class Base(nested: Nested?) {
}
}
internal class Derived : Base(Base.Nested(Base.Nested.FIELD))
internal class Derived : Base(Nested(Nested.FIELD))
@@ -1,5 +1,12 @@
// ERROR: Modifier 'protected' is not applicable inside 'object'
internal object Outer {
fun foo() {
val nested1 = Nested1(1)
val nested2 = Nested2(2)
val nested3 = Nested3(3)
val nested4 = Nested4(4)
}
private class Nested1() {
constructor(a: Int) : this() {}
@@ -36,11 +43,4 @@ internal object Outer {
private constructor(b: Boolean) : this() {}
}
fun foo() {
val nested1 = Nested1(1)
val nested2 = Nested2(2)
val nested3 = Nested3(3)
val nested4 = Nested4(4)
}
}
+1 -1
View File
@@ -28,7 +28,7 @@ public class Java8Class {
foo1((Integer i) -> {
helper();
if (i > 1) {
return "42";
return null;
}
return "43";
+1 -1
View File
@@ -7,7 +7,7 @@
class Java8Class {
fun foo0(r: Function0<String>) {}
fun foo1(r: Function1<Int, String>) {}
fun foo1(r: Function1<Int, String?>) {}
fun foo2(r: Function2<Int, Int, String>) {}
+1 -1
View File
@@ -2,7 +2,7 @@ package demo
internal class Test {
fun test(vararg args: Any?) {
var argsx = args
var args = args
args = arrayOf(1, 2, 3)
}
}
+1 -1
View File
@@ -3,5 +3,5 @@ internal open class Base {
}
internal class Derived : Base() {
var field: Base.Nested? = null
var field: Nested? = null
}
+1 -2
View File
@@ -1,10 +1,9 @@
import java.io.*;
import java.io.*;
class FileRead {
public static void main(String args[]) {
try {
FileInputStream fstream = new FileInputStream();
FileInputStream fstream = new FileInputStream(new File("file.txt"));
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
+4 -5
View File
@@ -1,18 +1,17 @@
// ERROR: None of the following functions can be called with the arguments supplied: public constructor FileInputStream(file: File!) defined in java.io.FileInputStream public constructor FileInputStream(fdObj: FileDescriptor!) defined in java.io.FileInputStream public constructor FileInputStream(name: String!) defined in java.io.FileInputStream
// ERROR: Type mismatch: inferred type is DataInputStream but InputStream! was expected
// ERROR: Assignments are not expressions, and only expressions are allowed in this context
// ERROR: Unresolved reference: close
import java.io.*
import java.lang.Exception
internal object FileRead {
@JvmStatic
fun main(args: Array<String>) {
try {
val fstream = FileInputStream()
val fstream = FileInputStream(File("file.txt"))
val `in` = DataInputStream(fstream)
val br = BufferedReader(InputStreamReader(`in`))
var strLine: String
while ((strLine = br.readLine()) != null) {
var strLine: String?
while (br.readLine().also { strLine = it } != null) {
println(strLine)
}
`in`.close()
+1 -3
View File
@@ -3,13 +3,11 @@ package com.voltvoodoo.saplo4j.model
import java.io.Serializable
class Language(protected var code: String) : Serializable {
override fun toString(): String {
return this.code
return code
}
}
internal open class Base {
internal open fun test() {}
override fun toString(): String {
+3 -4
View File
@@ -2,15 +2,14 @@ package com.voltvoodoo.saplo4j.model
import java.io.Serializable
class Language(protected var code: String?) : Serializable {
class Language(protected var code: String) : Serializable {
fun equals(other: Language): Boolean {
return other.toString() == this.toString()
}
companion object {
var ENGLISH: Language? = Language("en")
var SWEDISH: Language? = Language("sv")
var ENGLISH = Language("en")
var SWEDISH = Language("sv")
private const val serialVersionUID = -2442762969929206780L
}
}
+1 -1
View File
@@ -2,6 +2,6 @@ import java.util.Calendar
internal abstract class MyCalendar : Calendar() {
fun foo() {
val i = Calendar.ALL_STYLES
val i = ALL_STYLES
}
}
@@ -4,6 +4,8 @@ import kotlinApi.KotlinClass;
class C {
int foo() {
KotlinClass.Companion.getStaticVar()
KotlinClass.staticVar = KotlinClass.staticVar * 2;
KotlinClass.Companion.setStaticProperty(KotlinClass.Companion.getStaticVar() + KotlinClass.Companion.getStaticProperty());
return KotlinClass.Companion.staticFun(1);
}
}
+7 -3
View File
@@ -1,9 +1,13 @@
import kotlinApi.KotlinClass
import kotlinApi.KotlinClass.Companion
import kotlinApi.KotlinClass.Companion.staticFun
import kotlinApi.KotlinClass.Companion.staticProperty
import kotlinApi.KotlinClass.Companion.staticVar
internal class C {
fun foo(): Int {
KotlinClass.staticVar = KotlinClass.staticVar * 2
KotlinClass.staticProperty = KotlinClass.staticVar + KotlinClass.staticProperty
return KotlinClass.staticFun(1)
staticVar = staticVar * 2
staticProperty = staticVar + staticProperty
return staticFun(1)
}
}
@@ -1,13 +1,16 @@
import kotlinApi.*
import kotlinApi.KotlinClass.Companion
import kotlinApi.KotlinClass.Companion.nullableStaticFun
import kotlinApi.KotlinClass.Companion.nullableStaticVar
import kotlinApi.KotlinClass.Companion.staticFun
import kotlinApi.KotlinClass.Companion.staticVar
internal class A {
fun foo(c: KotlinClass): Int {
return (c.nullableProperty!!.length
+ c.property.length
+ KotlinClass.nullableStaticVar!!
+ KotlinClass.staticVar
+ KotlinClass.nullableStaticFun(1)!!
+ KotlinClass.staticFun(1)
+ nullableStaticVar!! + staticVar
+ nullableStaticFun(1)!! + staticFun(1)
+ nullableGlobalFunction("")!!.length
+ globalFunction("").length)
}
+8 -5
View File
@@ -1,11 +1,14 @@
import kotlinApi.KotlinObject
import kotlinApi.KotlinObject.foo
import kotlinApi.KotlinObject.property1
import kotlinApi.KotlinObject.property2
internal class C {
fun foo(): Int {
KotlinObject.property1 = 1
KotlinObject.property2 = 2
property1 = 1
property2 = 2
return KotlinObject.foo() +
KotlinObject.property1 +
KotlinObject.property2
property1 +
property2
}
}
}
@@ -1,7 +1,8 @@
import kotlinApi.KotlinClass
import kotlinApi.KotlinClass.Companion.staticProperty
internal class C {
fun foo(): Int {
return KotlinClass.staticProperty
return staticProperty
}
}
+2 -2
View File
@@ -3,8 +3,8 @@ import java.util.*
class ForEach {
fun test() {
val xs: ArrayList<Any?> = ArrayList()
val ys: MutableList<Any?> = LinkedList<Any>()
val xs: ArrayList<Any> = ArrayList()
val ys: MutableList<Any> = LinkedList<Any>()
for (x in xs) {
ys.add(x)
}
@@ -34,9 +34,10 @@ class A {
}
for (Map.Entry<String, Integer> entry : map.entrySet()) {
String key = entry.getKey();
Integer value = entry.getValue();
entry.setValue(value + 1);
if (entry.getKey() != null) {
println(value + 1)
}
}
}
}
@@ -1,9 +1,9 @@
import java.util.HashMap
internal enum class E {
A, B, C
}
import java.lang.Exception
import java.lang.RuntimeException
import java.util.*
import kotlin.collections.Map.Entry
internal enum class E { A, B, C }
internal class A {
fun foo(list: List<String?>, collection: Collection<Int?>, map: Map<Int?, Int?>) {
val a = "".length
@@ -16,14 +16,13 @@ internal class A {
val h = map.entries.size
}
fun bar(list: MutableList<String?>, map: HashMap<String?, Int?>) {
fun bar(list: MutableList<String>, map: HashMap<String?, Int>) {
val c = "a"[0]
val b = 10.toByte()
val i = 10.1.toInt()
val f = 10.1.toFloat()
val l = 10.1.toLong()
val s = 10.1.toShort()
try {
val removed = list.removeAt(10)
val isRemoved = list.remove("a")
@@ -31,11 +30,10 @@ internal class A {
System.err.println(e.message)
throw RuntimeException(e.cause)
}
for (entry in map.entries) {
val key = entry.key
val value = entry.value
entry.setValue(value!! + 1)
for ((key, value) in map) {
if (key != null) {
println(value + 1)
}
}
}
}
}
+2 -2
View File
@@ -2,8 +2,8 @@ import javaApi.WithVarargConstructor
internal class X {
fun foo() {
val o1 = WithVarargConstructor(1, *arrayOf("a"))
val o2 = WithVarargConstructor(2, arrayOf("a"), arrayOf("b"))
val o1 = WithVarargConstructor(1, *arrayOf<Any>("a"))
val o2 = WithVarargConstructor(2, arrayOf<Any>("a"), arrayOf<Any>("b"))
val o3 = WithVarargConstructor(2, "a")
}
}
@@ -1,12 +1,11 @@
// ERROR: Type mismatch: inferred type is T? but T was expected
import java.util.*
internal class A<T> {
fun foo(nonMutableCollection: Collection<String>,
mutableCollection: MutableCollection<String>,
mutableSet: MutableSet<T>,
mutableMap: MutableMap<String, T>) {
mutableSet: MutableSet<T?>,
mutableMap: MutableMap<String, T?>) {
mutableCollection.addAll(nonMutableCollection)
mutableSet.add(mutableMap.remove("a"))
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
import java.util.*;
class Iterator {
class IteratorTest {
Map<String, String> mutableMap1 = new HashMap<>();
Map<String, String> mutableMap2 = new HashMap<>();
+1 -2
View File
@@ -1,7 +1,6 @@
import java.util.*
internal class Iterator {
internal class IteratorTest {
var mutableMap1: MutableMap<String, String> = HashMap()
var mutableMap2: MutableMap<String, String> = HashMap()
+11 -21
View File
@@ -5,34 +5,24 @@ internal interface WindowListener {
}
internal interface EmptyWindowListener
internal open class EmptyWindowAdapter : EmptyWindowListener
internal open class WindowAdapter : WindowListener {
override fun windowClosing() {}
}
internal open class Frame {
fun addWindowListener(listener: WindowListener?) {}
fun addWindowListener(listener: WindowListener) {}
}
internal class Client : Frame() {
init {
val a: WindowAdapter = object : WindowAdapter() {
override fun windowClosing() {}
}
addWindowListener(a)
addWindowListener(object : WindowAdapter() {
override fun windowClosing() {}
})
val b: EmptyWindowListener = object : EmptyWindowListener {
}
val c: EmptyWindowAdapter = object : EmptyWindowAdapter() {
}
internal class Client : Frame() {init {
val a: WindowAdapter = object : WindowAdapter() {
override fun windowClosing() {}
}
addWindowListener(a)
addWindowListener(object : WindowAdapter() {
override fun windowClosing() {}
})
val b: EmptyWindowListener = object : EmptyWindowListener {}
val c: EmptyWindowAdapter = object : EmptyWindowAdapter() {}
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ internal class X {
}
internal class C {
fun foo(map: HashMap<String, String>): String {
fun foo(map: HashMap<String, String?>): String? {
return map["a"]
}
+2 -2
View File
@@ -3,7 +3,7 @@ import java.util.Arrays
class Foo {
fun test() {
val list: List<String?> = Arrays.asList("a", "b")
val array1: Array<Any?> = list.toTypedArray()
val array2: Array<Any?> = list.toTypedArray()
val array1: Array<Any> = list.toTypedArray()
val array2: Array<Any> = list.toTypedArray()
}
}
File diff suppressed because it is too large Load Diff