New J2K: Split old j2k and new j2k tests

This commit is contained in:
Ilya Kirillov
2019-03-28 14:20:17 +03:00
committed by Ilya Kirillov
parent 02a206bf7c
commit b411e8e18e
1631 changed files with 14067 additions and 1513 deletions
+33
View File
@@ -0,0 +1,33 @@
// 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() {}
protected constructor(c: Char) : this() {}
private constructor(b: Boolean) : this() {}
}
protected class Nested2() {
constructor(a: Int) : this() {}
protected constructor(c: Char) : this() {}
private constructor(b: Boolean) : this() {}
}
internal class Nested3() {
constructor(a: Int) : this() {}
protected constructor(c: Char) : this() {}
private constructor(b: Boolean) : this() {}
}
class Nested4() {
constructor(a: Int) : this() {}
protected constructor(c: Char) : this() {}
private constructor(b: Boolean) : this() {}
}
}
+6
View File
@@ -0,0 +1,6 @@
//file
class Test {
public static int foo(String[] args) {
return args.length;
}
}
+5
View File
@@ -0,0 +1,5 @@
internal object Test {
fun foo(args: Array<String?>): Int {
return args.size
}
}
+66
View File
@@ -0,0 +1,66 @@
//file
// This is an end-of-line comment
/*
This is a block comment
*/
/*doc comment of class*/
//one line comment of class
//another one
/*another doc*/
class C {
// This is a class comment
/**
* This is a field doc comment.
*/
private int i;
/**
* This is a function doc comment.
*/
public void foo() {
/* This is a function comment */
}
//simple one line comment for function
void f1() {
}
//simple one line comment for field
int j;
//double c style
//comment before function
void f2() {
}
//double c style
//comment before field
int k;
//combination
/** of
*/
//
/**
* different
*/
//comments
void f3() {}
//combination
/** of
*/
//
/**
* different
*/
//comments
int l;
/*two*/ /*comments*//*line*/
int z;
}
+63
View File
@@ -0,0 +1,63 @@
// This is an end-of-line comment
/*
This is a block comment
*/
/*doc comment of class*/
//one line comment of class
//another one
/*another doc*/
internal class C {
// This is a class comment
/**
* This is a field doc comment.
*/
private val i: Int = 0
//simple one line comment for field
var j: Int = 0
//double c style
//comment before field
var k: Int = 0
//combination
/** of
*/
//
/**
* different
*/
//comments
var l: Int = 0
/*two*/ /*comments*//*line*/
var z: Int = 0
/**
* This is a function doc comment.
*/
fun foo() {
/* This is a function comment */
}
//simple one line comment for function
fun f1() {}
//double c style
//comment before function
fun f2() {}
//combination
/** of
*/
//
/**
* different
*/
//comments
fun f3() {}
}
+10
View File
@@ -0,0 +1,10 @@
//file
class Outer {
public static Object o = new Object();
public static class Nested {
public void foo() {
o = null;
}
}
}
+9
View File
@@ -0,0 +1,9 @@
internal object Outer {
var o: Any? = Any()
class Nested {
fun foo() {
o = null
}
}
}
+9
View File
@@ -0,0 +1,9 @@
//file
package demo;
class C {
private final int i;
public C(int i) {
this.i = i;
}
}
+3
View File
@@ -0,0 +1,3 @@
package demo
internal class C(private val i: Int)
+19
View File
@@ -0,0 +1,19 @@
//file
import java.util.HashMap;
class G <T extends String> {
public <T> G(T t) {
}
}
public class Java {
void test() {
HashMap m = new HashMap();
m.put(1, 1);
}
void test2() {
HashMap<?, ?> m = new HashMap();
G g = new G("");
G<String> g2 = new G<String>("");
}
}
+18
View File
@@ -0,0 +1,18 @@
// ERROR: Type inference failed: Not enough information to infer parameter K in constructor HashMap<K : Any!, V : Any!>() Please specify it explicitly.
// ERROR: Type inference failed: Not enough information to infer parameter K in constructor HashMap<K : Any!, V : Any!>() Please specify it explicitly.
import java.util.HashMap
internal class G<T : String>(t: T)
class Java {
internal fun test() {
val m = HashMap()
m.put(1, 1)
}
internal fun test2() {
val m = HashMap()
val g = G("")
val g2 = G("")
}
}
+9
View File
@@ -0,0 +1,9 @@
//file
package demo;
class Test {
static void bar(int a) {
if (a < 0)
throw new RuntimeException("a = " + a);
}
}
+8
View File
@@ -0,0 +1,8 @@
package demo
internal object Test {
fun bar(a: Int) {
if (a < 0)
throw RuntimeException("a = $a")
}
}
+15
View File
@@ -0,0 +1,15 @@
public class AppInfo {
long mLastUpdateTime;
String mName;
String mIcon;
public AppInfo(String name, String icon, long lastUpdateTime) {
mName = name;
mIcon = icon;
mLastUpdateTime = lastUpdateTime;
}
}
+2
View File
@@ -0,0 +1,2 @@
class AppInfo(internal var mName: String, internal var mIcon: String, internal var mLastUpdateTime: Long)
+19
View File
@@ -0,0 +1,19 @@
//file
package demo;
class Test {
void test() {
int a = 0;
int b = 1;
int c = 2;
int d = 4;
int y = a // polyadic expression case
+ b // x2
+ c // x3
+ d; // x4
int z = a // binary expression case
+ b; // x4
int j = b +
c;
}
}
+20
View File
@@ -0,0 +1,20 @@
package demo
internal class Test {
fun test() {
val a = 0
val b = 1
val c = 2
val d = 4
val y = (a // polyadic expression case
+ b // x2
+ c // x3
+ d) // x4
val z = (a // binary expression case
+ b) // x4
val j = b + c
}
}
+5
View File
@@ -0,0 +1,5 @@
public class TestBoxedEqEqPrimitive {
public boolean test(Double value) {
return value == 3.14;
}
}
+5
View File
@@ -0,0 +1,5 @@
class TestBoxedEqEqPrimitive {
fun test(value: Double): Boolean {
return value == 3.14
}
}
+27
View File
@@ -0,0 +1,27 @@
import java.util.List;
public class TestSpecialMethodForTypeValue {
public byte testByte(List<Byte> xs) {
return xs.get(0).byteValue();
}
public short testShort(List<Short> xs) {
return xs.get(0).shortValue();
}
public int testInt(List<Integer> xs) {
return xs.get(0).intValue();
}
public long testLong(List<Long> xs) {
return xs.get(0).longValue();
}
public float testFloat(List<Float> xs) {
return xs.get(0).floatValue();
}
public double testDouble(List<Double> xs) {
return xs.get(0).doubleValue();
}
}
+25
View File
@@ -0,0 +1,25 @@
class TestSpecialMethodForTypeValue {
fun testByte(xs: List<Byte>): Byte {
return xs[0]
}
fun testShort(xs: List<Short>): Short {
return xs[0]
}
fun testInt(xs: List<Int>): Int {
return xs[0]
}
fun testLong(xs: List<Long>): Long {
return xs[0]
}
fun testFloat(xs: List<Float>): Float {
return xs[0]
}
fun testDouble(xs: List<Double>): Double {
return xs[0]
}
}
+11
View File
@@ -0,0 +1,11 @@
import java.util.List;
class X {
private final List<Y> list;
X(List<Y> list) {
this.list = list;
}
class Y{}
}
+4
View File
@@ -0,0 +1,4 @@
internal class X(private val list: List<Y>) {
internal inner class Y
}
+7
View File
@@ -0,0 +1,7 @@
class Base {
class Nested{}
}
class Derived extends Base {
Nested field;
}
+7
View File
@@ -0,0 +1,7 @@
internal open class Base {
internal inner class Nested
}
internal class Derived : Base() {
var field: Base.Nested? = null
}
+14
View File
@@ -0,0 +1,14 @@
//file
package demo;
class Test {
void putInt(Integer i) {}
void test() {
byte b = 10;
putInt(b);
Byte b2 = 10;
putInt(b2);
}
}
+13
View File
@@ -0,0 +1,13 @@
package demo
internal class Test {
fun putInt(i: Int) {}
fun test() {
val b: Byte = 10
putInt(b.toInt())
val b2: Byte = 10
putInt(b2.toInt())
}
}
+11
View File
@@ -0,0 +1,11 @@
//file
package demo;
class Test {
void putInt(Integer i) {}
void test() {
int i = 10;
putInt(i);
}
}
+10
View File
@@ -0,0 +1,10 @@
package demo
internal class Test {
fun putInt(i: Int) {}
fun test() {
val i = 10
putInt(i)
}
}
+11
View File
@@ -0,0 +1,11 @@
//file
package demo;
class Test {
void putInt(int i) {}
void test() {
byte b = 10;
putInt(b);
}
}
+10
View File
@@ -0,0 +1,10 @@
package demo
internal class Test {
fun putInt(i: Int) {}
fun test() {
val b: Byte = 10
putInt(b.toInt())
}
}
+34
View File
@@ -0,0 +1,34 @@
//file
public class Identifier<T> {
private final T myName;
private boolean myHasDollar;
private boolean myNullable = true;
public Identifier(T name) {
myName = name;
}
public Identifier(T name, boolean isNullable) {
myName = name;
myNullable = isNullable;
}
public Identifier(T name, boolean hasDollar, boolean isNullable) {
myName = name;
myHasDollar = hasDollar;
myNullable = isNullable;
}
@Override
public T getName() {
return myName;
}
}
public class User {
public static void main(String[] args) {
Identifier<?> i1 = new Identifier<String>("name", false, true);
Identifier i2 = new Identifier<String>("name", false);
Identifier i3 = new Identifier<String>("name");
}
}
+29
View File
@@ -0,0 +1,29 @@
class Identifier<T> {
val name: T
private var myHasDollar = false
private var myNullable = true
constructor(name: T) {
this.name = name
}
constructor(name: T, isNullable: Boolean) {
this.name = name
myNullable = isNullable
}
constructor(name: T, hasDollar: Boolean, isNullable: Boolean) {
this.name = name
myHasDollar = hasDollar
myNullable = isNullable
}
}
object User {
@JvmStatic
fun main(args: Array<String>) {
val i1: Identifier<*> = Identifier<String?>("name", false, true)
val i2 = Identifier("name", false)
val i3 = Identifier("name")
}
}
+6
View File
@@ -0,0 +1,6 @@
import java.util.Map.Entry;
public class A {
void foo(Entry<Object, Object> o) {
}
}
+5
View File
@@ -0,0 +1,5 @@
import kotlin.collections.Map.Entry
class A {
internal fun foo(o: Entry<Any?, Any?>?) {}
}
+36
View File
@@ -0,0 +1,36 @@
//file
package test;
class Base {
@Override
public int hashCode() {
return super.hashCode();
}
@Override
public boolean equals(Object o) {
return super.equals(o);
}
@Override
public String toString() {
return super.toString();
}
}
class Child extends Base {
@Override
public int hashCode() {
return super.hashCode();
}
@Override
public boolean equals(Object o) {
return super.equals(o);
}
@Override
public String toString() {
return super.toString();
}
}
+29
View File
@@ -0,0 +1,29 @@
package test
internal open class Base {
override fun hashCode(): Int {
return super.hashCode()
}
override fun equals(o: Any?): Boolean {
return super.equals(o)
}
override fun toString(): String {
return super.toString()
}
}
internal class Child : Base() {
override fun hashCode(): Int {
return super.hashCode()
}
override fun equals(o: Any?): Boolean {
return super.equals(o)
}
override fun toString(): String {
return super.toString()
}
}
+12
View File
@@ -0,0 +1,12 @@
//file
package demo;
class Test {
Test(Integer i) {
}
void test() {
int i = 10;
new Test(i);
}
}
+9
View File
@@ -0,0 +1,9 @@
package demo
internal class Test(i: Int?) {
fun test() {
val i = 10
Test(i)
}
}
+12
View File
@@ -0,0 +1,12 @@
//file
package demo;
class Test {
Test(int i) {
}
void test() {
byte b = 10;
new Test(b);
}
}
+9
View File
@@ -0,0 +1,9 @@
package demo
internal class Test(i: Int) {
fun test() {
val b: Byte = 10
Test(b.toInt())
}
}
+12
View File
@@ -0,0 +1,12 @@
//file
package demo;
class Test {
Integer getInteger(Integer i) {
return i;
}
void test() {
int i = getInteger(10);
}
}
+11
View File
@@ -0,0 +1,11 @@
package demo
internal class Test {
fun getInteger(i: Int): Int {
return i
}
fun test() {
val i = getInteger(10)
}
}
+7
View File
@@ -0,0 +1,7 @@
//file
class Test {
int getInt() {
byte b = 10;
return b;
}
}
+7
View File
@@ -0,0 +1,7 @@
internal class Test {
val int: Int
get() {
val b: Byte = 10
return b.toInt()
}
}
+17
View File
@@ -0,0 +1,17 @@
import java.io.*;
import java.io.*;
class FileRead {
public static void main(String args[]) {
try {
FileInputStream fstream = new FileInputStream();
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
while ((strLine = br.readLine()) != null) { System.out.println (strLine); }
in.close();
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
}
}
+24
View File
@@ -0,0 +1,24 @@
// 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.*
internal object FileRead {
@JvmStatic
fun main(args: Array<String>) {
try {
val fstream = FileInputStream()
val `in` = DataInputStream(fstream)
val br = BufferedReader(InputStreamReader(`in`))
var strLine: String
while ((strLine = br.readLine()) != null) {
println(strLine)
}
`in`.close()
} catch (e: Exception) {
System.err.println("Error: " + e.message)
}
}
}
+22
View File
@@ -0,0 +1,22 @@
//file
package demo;
class Container {
String myString = "1";
}
class One {
static Container myContainer = new Container();
}
class StringContainer {
StringContainer(String s) {}
}
class Test {
void putString(String s) { }
void test() {
putString(One.myContainer.myString);
new StringContainer(One.myContainer.myString);
}
}
+19
View File
@@ -0,0 +1,19 @@
package demo
internal class Container {
var myString = "1"
}
internal object One {
var myContainer = Container()
}
internal class StringContainer(s: String?)
internal class Test {
fun putString(s: String) {}
fun test() {
putString(One.myContainer.myString)
StringContainer(One.myContainer.myString)
}
}
+22
View File
@@ -0,0 +1,22 @@
//file
package demo;
class Container {
int myInt = 1;
}
class One {
static Container myContainer = new Container();
}
class IntContainer {
IntContainer(int i) {}
}
class Test {
void putInt(int i) { }
void test() {
putInt(One.myContainer.myInt);
new IntContainer(One.myContainer.myInt);
}
}
+19
View File
@@ -0,0 +1,19 @@
package demo
internal class Container {
var myInt = 1
}
internal object One {
var myContainer = Container()
}
internal class IntContainer(i: Int)
internal class Test {
fun putInt(i: Int) {}
fun test() {
putInt(One.myContainer.myInt)
IntContainer(One.myContainer.myInt)
}
}
+14
View File
@@ -0,0 +1,14 @@
//file
package demo;
class Container {
int myInt = 1;
}
class One {
static Container myContainer = new Container();
}
class Test {
byte b = One.myContainer.myInt;
}
+13
View File
@@ -0,0 +1,13 @@
package demo
internal class Container {
var myInt = 1
}
internal object One {
var myContainer = Container()
}
internal class Test {
var b = One.myContainer.myInt.toByte()
}
+7
View File
@@ -0,0 +1,7 @@
//file
class Test {
public static String toFileSystemSafeName(String name) {
int size = name.length();
return name;
}
}
+6
View File
@@ -0,0 +1,6 @@
internal object Test {
fun toFileSystemSafeName(name: String): String {
val size = name.length
return name
}
}
+16
View File
@@ -0,0 +1,16 @@
//file
package demo;
class Container {
int myInt = 1;
}
class One {
static Container myContainer = new Container();
}
class Test {
void test() {
byte b = One.myContainer.myInt;
}
}
+15
View File
@@ -0,0 +1,15 @@
package demo
internal class Container {
var myInt = 1
}
internal object One {
var myContainer = Container()
}
internal class Test {
fun test() {
val b = One.myContainer.myInt.toByte()
}
}
+19
View File
@@ -0,0 +1,19 @@
//file
package test;
import java.io.File;
/**
* User: ignatov
*/
public class Test {
public static boolean isDir(File parent) {
if (parent == null || !parent.exists()) {
return false;
}
boolean result = true;
if (parent.isDirectory()) {
return true;
} else
return false;
}
}
+19
View File
@@ -0,0 +1,19 @@
package test
import java.io.File
/**
* User: ignatov
*/
object Test {
fun isDir(parent: File?): Boolean {
if (parent == null || !parent.exists()) {
return false
}
val result = true
return if (parent.isDirectory) {
true
} else
false
}
}
+26
View File
@@ -0,0 +1,26 @@
//file
package demo;
class Container {
boolean myBoolean = true;
}
class One {
static Container myContainer = new Container();
}
class Test {
void test() {
if (One.myContainer.myBoolean)
System.out.println("Ok");
String s = One.myContainer.myBoolean ? "YES" : "NO";
while (One.myContainer.myBoolean)
System.out.println("Ok");
do {
System.out.println("Ok");
} while (One.myContainer.myBoolean)
}
}
+20
View File
@@ -0,0 +1,20 @@
package demo
internal class Container {
var myBoolean = true
}
internal object One {
var myContainer = Container()
}
internal class Test {
fun test() {
if (One.myContainer.myBoolean) println("Ok")
val s = if (One.myContainer.myBoolean) "YES" else "NO"
while (One.myContainer.myBoolean) println("Ok")
do {
println("Ok")
} while (One.myContainer.myBoolean)
}
}
+16
View File
@@ -0,0 +1,16 @@
//file
class Test {
void test() {
boolean res = true;
res &= false;
res |= false;
res ^= false;
System.out.println(true & false);
System.out.println(true | false);
System.out.println(true ^ false);
System.out.println(!true);
System.out.println(true && false);
System.out.println(true || false);
}
}
+15
View File
@@ -0,0 +1,15 @@
internal class Test {
fun test() {
var res = true
res = res and false
res = res or false
res = res xor false
println(true and false)
println(true or false)
println(true xor false)
println(!true)
println(true && false)
println(true || false)
}
}
+31
View File
@@ -0,0 +1,31 @@
//file
package com.voltvoodoo.saplo4j.model;
import java.io.Serializable;
public class Language implements Serializable {
protected String code;
public Language(String code) {
this.code = code;
}
public String toString() {
return this.code;
}
}
class Base {
void test() {}
public String toString() {
return "BASE";
}
}
class Child extends Base {
void test() {}
public String toString() {
return "Child";
}
}
+25
View File
@@ -0,0 +1,25 @@
package com.voltvoodoo.saplo4j.model
import java.io.Serializable
class Language(protected var code: String) : Serializable {
override fun toString(): String {
return this.code
}
}
internal open class Base {
internal open fun test() {}
override fun toString(): String {
return "BASE"
}
}
internal class Child : Base() {
override fun test() {}
override fun toString(): String {
return "Child"
}
}
+20
View File
@@ -0,0 +1,20 @@
//file
package com.voltvoodoo.saplo4j.model;
import java.io.Serializable;
public class Language implements Serializable {
public static Language ENGLISH = new Language("en");
public static Language SWEDISH = new Language("sv");
protected String code;
private static final long serialVersionUID = -2442762969929206780L;
public Language(String code) {
this.code = code;
}
public boolean equals(Language other) {
return other.toString().equals(this.toString());
}
}
+16
View File
@@ -0,0 +1,16 @@
package com.voltvoodoo.saplo4j.model
import java.io.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")
private const val serialVersionUID = -2442762969929206780L
}
}
+9
View File
@@ -0,0 +1,9 @@
//file
class Test {
void putInt(int i) {}
void test() {
Byte b = 10;
putInt(b);
}
}
+8
View File
@@ -0,0 +1,8 @@
internal class Test {
fun putInt(i: Int) {}
fun test() {
val b: Byte = 10
putInt(b.toInt())
}
}
+17
View File
@@ -0,0 +1,17 @@
//file
package demo;
class Test {
String test() {
String s1 = "";
String s2 = "";
String s3 = "";
if (s1.isEmpty() && s2.isEmpty())
return "OK";
if (s1.isEmpty() && s2.isEmpty() && s3.isEmpty())
return "OOOK";
return "";
}
}
+14
View File
@@ -0,0 +1,14 @@
package demo
internal class Test {
fun test(): String {
val s1 = ""
val s2 = ""
val s3 = ""
if (s1.isEmpty() && s2.isEmpty())
return "OK"
return if (s1.isEmpty() && s2.isEmpty() && s3.isEmpty()) "OOOK" else ""
}
}
+8
View File
@@ -0,0 +1,8 @@
//file
package demo;
class Program {
public static void main(String[] args) {
System.out.println("Halo!");
}
}
+8
View File
@@ -0,0 +1,8 @@
package demo
internal object Program {
@JvmStatic
fun main(args: Array<String>) {
println("Halo!")
}
}
+17
View File
@@ -0,0 +1,17 @@
//file
class Test {
public static int getInt(int i) {
switch (i) {
case 0:
return 0;
case 1:
return 1;
case 2:
return 2;
case 3:
return 3;
default:
return -1;
}
}
}
+11
View File
@@ -0,0 +1,11 @@
internal object Test {
fun getInt(i: Int): Int {
return when (i) {
0 -> 0
1 -> 1
2 -> 2
3 -> 3
else -> -1
}
}
}
+10
View File
@@ -0,0 +1,10 @@
//file
package demo;
class Test {
void test() {
for(int i = 0; i < 10; ++i) {
System.out.println(i)
}
}
}
+9
View File
@@ -0,0 +1,9 @@
package demo
internal class Test {
fun test() {
for (i in 0..9) {
println(i)
}
}
}
+32
View File
@@ -0,0 +1,32 @@
//file
class Test {
public void printNumbers() {
for(int i1 = 0; i1 < 1; i1++)
System.out.println(i1);
byte b = 1;
for(int i2 = 0; i2 < b; i2++)
System.out.println(i2);
short s = 1;
for(int i3 = 0; i3 < s; i3++)
System.out.println(i3);
long l = 1L;
for(int i4 = 0; i4 < l; i4++)
System.out.println(i4);
double d = 1.0;
for(int i5 = 0; i5 < d; i5++)
System.out.println(i5);
float f = 1.0f;
for(int i6 = 0; i6 < f; i6++)
System.out.println(i6);
char c = 1;
for(int i7 = 0; i7 < c; i7++)
System.out.println(i7);
}
}
+40
View File
@@ -0,0 +1,40 @@
internal class Test {
fun printNumbers() {
for (i1 in 0..0)
println(i1)
val b: Byte = 1
for (i2 in 0 until b)
println(i2)
val s: Short = 1
for (i3 in 0 until s)
println(i3)
val l = 1L
for (i4 in 0 until l)
println(i4)
val d = 1.0
var i5 = 0
while (i5 < d) {
println(i5)
i5++
}
val f = 1.0f
var i6 = 0
while (i6 < f) {
println(i6)
i6++
}
val c = 1.toChar()
var i7 = 0
while (i7 < c.toInt()) {
println(i7)
i7++
}
}
}
+9
View File
@@ -0,0 +1,9 @@
//file
package demo;
class C {
public C(int a) {
abc = a * 2;
}
int abc = 0;
}
+9
View File
@@ -0,0 +1,9 @@
package demo
internal class C(a: Int) {
var abc = 0
init {
abc = a * 2
}
}
+138
View File
@@ -0,0 +1,138 @@
class A {
public void equals() {
int i = 1;
byte b = 1;
short s = 1;
long l = 1;
double d = 1.0;
float f = 1.0f;
char c = 1;
t(i == i);
t(i == b);
t(i == s);
t(i == l);
t(i == d);
t(i == f);
t(i == c);
t(b == i);
t(b == b);
t(b == s);
t(b == l);
t(b == d);
t(b == f);
t(b == c);
t(s == i);
t(s == b);
t(s == s);
t(s == l);
t(s == d);
t(s == f);
t(s == c);
t(l == i);
t(l == b);
t(l == s);
t(l == l);
t(l == d);
t(l == f);
t(l == c);
t(d == i);
t(d == b);
t(d == s);
t(d == l);
t(d == d);
t(d == f);
t(d == c);
t(f == i);
t(f == b);
t(f == s);
t(f == l);
t(f == d);
t(f == f);
t(f == c);
t(c == i);
t(c == b);
t(c == s);
t(c == l);
t(c == d);
t(c == f);
t(c == c);
t(i != d);
}
public void compare() {
int i = 1;
byte b = 1;
short s = 1;
long l = 1;
double d = 1.0;
float f = 1.0f;
char c = 1;
t(i > i);
t(i > b);
t(i > s);
t(i > l);
t(i > d);
t(i > f);
t(i > c);
t(b > i);
t(b > b);
t(b > s);
t(b > l);
t(b > d);
t(b > f);
t(b > c);
t(s > i);
t(s > b);
t(s > s);
t(s > l);
t(s > d);
t(s > f);
t(s > c);
t(l > i);
t(l > b);
t(l > s);
t(l > l);
t(l > d);
t(l > f);
t(l > c);
t(d > i);
t(d > b);
t(d > s);
t(d > l);
t(d > d);
t(d > f);
t(d > c);
t(f > i);
t(f > b);
t(f > s);
t(f > l);
t(f > d);
t(f > f);
t(f > c);
t(c > i);
t(c > b);
t(c > s);
t(c > l);
t(c > d);
t(c > f);
t(c > c);
}
private void t(boolean b) {
}
}
+137
View File
@@ -0,0 +1,137 @@
internal class A {
fun equals() {
val i = 1
val b: Byte = 1
val s: Short = 1
val l: Long = 1
val d = 1.0
val f = 1.0f
val c = 1.toChar()
t(i == i)
t(i == b.toInt())
t(i == s.toInt())
t(i.toLong() == l)
t(i.toDouble() == d)
t(i.toFloat() == f)
t(i == c.toInt())
t(b.toInt() == i)
t(b == b)
t(b.toShort() == s)
t(b.toLong() == l)
t(b.toDouble() == d)
t(b.toFloat() == f)
t(b == c.toByte())
t(s.toInt() == i)
t(s == b.toShort())
t(s == s)
t(s.toLong() == l)
t(s.toDouble() == d)
t(s.toFloat() == f)
t(s == c.toShort())
t(l == i.toLong())
t(l == b.toLong())
t(l == s.toLong())
t(l == l)
t(l.toDouble() == d)
t(l.toFloat() == f)
t(l == c.toLong())
t(d == i.toDouble())
t(d == b.toDouble())
t(d == s.toDouble())
t(d == l.toDouble())
t(d == d)
t(d == f.toDouble())
t(d == c.toDouble())
t(f == i.toFloat())
t(f == b.toFloat())
t(f == s.toFloat())
t(f == l.toFloat())
t(f.toDouble() == d)
t(f == f)
t(f == c.toFloat())
t(c.toInt() == i)
t(c.toByte() == b)
t(c.toShort() == s)
t(c.toLong() == l)
t(c.toDouble() == d)
t(c.toFloat() == f)
t(c == c)
t(i.toDouble() != d)
}
fun compare() {
val i = 1
val b: Byte = 1
val s: Short = 1
val l: Long = 1
val d = 1.0
val f = 1.0f
val c = 1.toChar()
t(i > i)
t(i > b)
t(i > s)
t(i > l)
t(i > d)
t(i > f)
t(i > c.toInt())
t(b > i)
t(b > b)
t(b > s)
t(b > l)
t(b > d)
t(b > f)
t(b > c.toByte())
t(s > i)
t(s > b)
t(s > s)
t(s > l)
t(s > d)
t(s > f)
t(s > c.toShort())
t(l > i)
t(l > b)
t(l > s)
t(l > l)
t(l > d)
t(l > f)
t(l > c.toLong())
t(d > i)
t(d > b)
t(d > s)
t(d > l)
t(d > d)
t(d > f)
t(d > c.toDouble())
t(f > i)
t(f > b)
t(f > s)
t(f > l)
t(f > d)
t(f > f)
t(f > c.toFloat())
t(c.toInt() > i)
t(c.toByte() > b)
t(c.toShort() > s)
t(c.toLong() > l)
t(c.toDouble() > d)
t(c.toFloat() > f)
t(c > c)
}
private fun t(b: Boolean) {}
}
+45
View File
@@ -0,0 +1,45 @@
//file
class Test {
public void operationsWithChar() {
char c = 1;
int i = 1;
b(i > c);
b(i >= c);
b(i < c);
b(i <= c);
b(c > i);
b(c >= i);
b(c < i);
b(c <= i);
b(c == i);
b(c != i);
b(i == c);
b(i != c);
i(i + c);
i(i - c);
i(i / c);
i(i * c);
i(i % c);
i(i | c);
i(i & c);
i(i << c);
i(i >> c);
i(c + i);
i(c - i);
i(c / i);
i(c * i);
i(c % i);
i(c | i);
i(c & i);
i(c << i);
i(c >> i);
}
public void b(boolean b) {}
public void i(int i) {}
}
+44
View File
@@ -0,0 +1,44 @@
internal class Test {
fun operationsWithChar() {
val c = 1.toChar()
val i = 1
b(i > c.toInt())
b(i >= c.toInt())
b(i < c.toInt())
b(i <= c.toInt())
b(c.toInt() > i)
b(c.toInt() >= i)
b(c.toInt() < i)
b(c.toInt() <= i)
b(c.toInt() == i)
b(c.toInt() != i)
b(i == c.toInt())
b(i != c.toInt())
i(i + c.toInt())
i(i - c.toInt())
i(i / c.toInt())
i(i * c.toInt())
i(i % c.toInt())
i(i or c.toInt())
i(i and c.toInt())
i(i shl c.toInt())
i(i shr c.toInt())
i(c.toInt() + i)
i(c.toInt() - i)
i(c.toInt() / i)
i(c.toInt() * i)
i(c.toInt() % i)
i(c.toInt() or i)
i(c.toInt() and i)
i(c.toInt() shl i)
i(c.toInt() shr i)
}
fun b(b: Boolean) {}
fun i(i: Int) {}
}
+8
View File
@@ -0,0 +1,8 @@
//file
import java.util.Calendar
abstract class MyCalendar extends Calendar {
public void foo() {
int i = ALL_STYLES;
}
}
+7
View File
@@ -0,0 +1,7 @@
import java.util.Calendar
internal abstract class MyCalendar : Calendar() {
fun foo() {
val i = Calendar.ALL_STYLES
}
}
@@ -0,0 +1,6 @@
//file
import java.util.*
class A {
List<String> list = new ArrayList<String>();
}
+5
View File
@@ -0,0 +1,5 @@
import java.util.*
internal class A {
var list: List<String> = ArrayList()
}
@@ -0,0 +1,7 @@
public class JavaClass {
public String v = "";
public void m(String s) {
s.
this.v.
}
}
@@ -0,0 +1,7 @@
// ERROR: The expression cannot be a selector (occur after a dot)
class JavaClass {
var v = ""
fun m(s: String) {
s.this.v.
}
}