Changed CRLF line-endings to LF

This commit is contained in:
Santeri Hiltunen
2013-01-29 16:00:01 +02:00
committed by Pavel V. Talanov
parent 3abeffb8b8
commit 453bb8b4f2
289 changed files with 5588 additions and 5588 deletions
@@ -1,178 +1,178 @@
/*
* Copyright 2010-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.jet.j2k;
import com.intellij.core.JavaCoreProjectEnvironment;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiJavaFile;
import junit.framework.Assert;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.IOException;
/**
* @author ignatov
*/
public class StandaloneJavaToKotlinConverterTest extends TestCase {
private final String myDataPath;
private final String myName;
@NotNull
private final static JavaCoreProjectEnvironment myJavaCoreEnvironment = JavaToKotlinTranslator.setUpJavaCoreEnvironment();
public StandaloneJavaToKotlinConverterTest(String dataPath, String name) {
myDataPath = dataPath;
myName = name;
}
@Override
protected void runTest() throws Throwable {
Converter converter = new Converter();
String javaPath = "tests/testData/" + getTestFilePath();
String kotlinPath = javaPath.replace(".jav", ".kt");
final File kotlinFile = new File(kotlinPath);
if (!kotlinFile.exists()) {
FileUtil.writeToFile(kotlinFile, "");
}
final String expected = StringUtil.convertLineSeparators(FileUtil.loadFile(kotlinFile));
final File javaFile = new File(javaPath);
final String javaCode = FileUtil.loadFile(javaFile);
String actual = "";
String parentFileName = javaFile.getParentFile().getName();
if (parentFileName.equals("expression")) {
actual = expressionToKotlin(converter, javaCode);
}
else if (parentFileName.equals("statement")) {
actual = statementToKotlin(converter, javaCode);
}
else if (parentFileName.equals("method")) {
actual = methodToKotlin(converter, javaCode);
}
else if (parentFileName.equals("class")) {
actual = fileToKotlin(converter, javaCode);
}
else if (parentFileName.equals("file")) {
actual = fileToKotlin(converter, javaCode);
}
else if (parentFileName.equals("comp")) actual = fileToFileWithCompatibilityImport(javaCode);
actual = StringUtil.convertLineSeparators(actual);
assert !actual.isEmpty() : "Specify what is it: file, class, method, statement or expression: " + javaPath + " parent: " + parentFileName;
final File tmp = new File(kotlinPath + ".tmp");
if (!expected.equals(actual)) FileUtil.writeToFile(tmp, actual);
if (expected.equals(actual) && tmp.exists()) //noinspection ResultOfMethodCallIgnored
{
tmp.delete();
}
Assert.assertEquals(expected, actual);
}
@NotNull
String getTestFilePath() {
return myDataPath + "/" + myName + ".jav";
}
@NotNull
@Override
public String getName() {
return "test_" + myName;
}
@NotNull
public static Test suite() {
TestSuite suite = new TestSuite();
// suite.addTest(new StandaloneJavaToKotlinConverterTest("ast/class/file", "kt-639"));
suite.addTest(TestCaseBuilder.suiteForDirectory("tests/testData", "/ast", new TestCaseBuilder.NamedTestFactory() {
@NotNull
@Override
public Test createTest(@NotNull String dataPath, @NotNull String name) {
return new StandaloneJavaToKotlinConverterTest(dataPath, name);
}
}));
return suite;
}
@NotNull
private static String fileToFileWithCompatibilityImport(@NotNull String text) {
return JavaToKotlinTranslator.generateKotlinCodeWithCompatibilityImport(text);
}
@NotNull
private String fileToKotlin(Converter converter, @NotNull String text) {
return generateKotlinCode(converter, JavaToKotlinTranslator.createFile(myJavaCoreEnvironment, text));
}
@NotNull
private static String generateKotlinCode(@NotNull Converter converter, @Nullable PsiFile file) {
if (file != null && file instanceof PsiJavaFile) {
JavaToKotlinTranslator.setClassIdentifiers(converter, file);
return prettify(converter.elementToKotlin(file));
}
return "";
}
@NotNull
private String methodToKotlin(Converter converter, String text) throws IOException {
String result = fileToKotlin(converter, "final class C {" + text + "}")
.replaceAll("class C\\(\\) \\{", "");
result = result.substring(0, result.lastIndexOf("}"));
return prettify(result);
}
@NotNull
private String statementToKotlin(Converter converter, String text) throws Exception {
String result = methodToKotlin(converter, "void main() {" + text + "}");
int pos = result.lastIndexOf("}");
result = result.substring(0, pos).replaceFirst("fun main\\(\\) : Unit \\{", "");
return prettify(result);
}
@NotNull
private String expressionToKotlin(Converter converter, String code) throws Exception {
String result = statementToKotlin(converter, "Object o =" + code + "}");
result = result.replaceFirst("var o : Any\\? =", "");
return prettify(result);
}
@NotNull
private static String prettify(@Nullable String code) {
if (code == null) {
return "";
}
return code
.trim()
.replaceAll("\r\n", "\n")
.replaceAll(" \n", "\n")
.replaceAll("\n ", "\n")
.replaceAll("\n+", "\n")
.replaceAll(" +", " ")
.trim()
;
}
}
/*
* Copyright 2010-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.jet.j2k;
import com.intellij.core.JavaCoreProjectEnvironment;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiJavaFile;
import junit.framework.Assert;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.IOException;
/**
* @author ignatov
*/
public class StandaloneJavaToKotlinConverterTest extends TestCase {
private final String myDataPath;
private final String myName;
@NotNull
private final static JavaCoreProjectEnvironment myJavaCoreEnvironment = JavaToKotlinTranslator.setUpJavaCoreEnvironment();
public StandaloneJavaToKotlinConverterTest(String dataPath, String name) {
myDataPath = dataPath;
myName = name;
}
@Override
protected void runTest() throws Throwable {
Converter converter = new Converter();
String javaPath = "tests/testData/" + getTestFilePath();
String kotlinPath = javaPath.replace(".jav", ".kt");
final File kotlinFile = new File(kotlinPath);
if (!kotlinFile.exists()) {
FileUtil.writeToFile(kotlinFile, "");
}
final String expected = StringUtil.convertLineSeparators(FileUtil.loadFile(kotlinFile));
final File javaFile = new File(javaPath);
final String javaCode = FileUtil.loadFile(javaFile);
String actual = "";
String parentFileName = javaFile.getParentFile().getName();
if (parentFileName.equals("expression")) {
actual = expressionToKotlin(converter, javaCode);
}
else if (parentFileName.equals("statement")) {
actual = statementToKotlin(converter, javaCode);
}
else if (parentFileName.equals("method")) {
actual = methodToKotlin(converter, javaCode);
}
else if (parentFileName.equals("class")) {
actual = fileToKotlin(converter, javaCode);
}
else if (parentFileName.equals("file")) {
actual = fileToKotlin(converter, javaCode);
}
else if (parentFileName.equals("comp")) actual = fileToFileWithCompatibilityImport(javaCode);
actual = StringUtil.convertLineSeparators(actual);
assert !actual.isEmpty() : "Specify what is it: file, class, method, statement or expression: " + javaPath + " parent: " + parentFileName;
final File tmp = new File(kotlinPath + ".tmp");
if (!expected.equals(actual)) FileUtil.writeToFile(tmp, actual);
if (expected.equals(actual) && tmp.exists()) //noinspection ResultOfMethodCallIgnored
{
tmp.delete();
}
Assert.assertEquals(expected, actual);
}
@NotNull
String getTestFilePath() {
return myDataPath + "/" + myName + ".jav";
}
@NotNull
@Override
public String getName() {
return "test_" + myName;
}
@NotNull
public static Test suite() {
TestSuite suite = new TestSuite();
// suite.addTest(new StandaloneJavaToKotlinConverterTest("ast/class/file", "kt-639"));
suite.addTest(TestCaseBuilder.suiteForDirectory("tests/testData", "/ast", new TestCaseBuilder.NamedTestFactory() {
@NotNull
@Override
public Test createTest(@NotNull String dataPath, @NotNull String name) {
return new StandaloneJavaToKotlinConverterTest(dataPath, name);
}
}));
return suite;
}
@NotNull
private static String fileToFileWithCompatibilityImport(@NotNull String text) {
return JavaToKotlinTranslator.generateKotlinCodeWithCompatibilityImport(text);
}
@NotNull
private String fileToKotlin(Converter converter, @NotNull String text) {
return generateKotlinCode(converter, JavaToKotlinTranslator.createFile(myJavaCoreEnvironment, text));
}
@NotNull
private static String generateKotlinCode(@NotNull Converter converter, @Nullable PsiFile file) {
if (file != null && file instanceof PsiJavaFile) {
JavaToKotlinTranslator.setClassIdentifiers(converter, file);
return prettify(converter.elementToKotlin(file));
}
return "";
}
@NotNull
private String methodToKotlin(Converter converter, String text) throws IOException {
String result = fileToKotlin(converter, "final class C {" + text + "}")
.replaceAll("class C\\(\\) \\{", "");
result = result.substring(0, result.lastIndexOf("}"));
return prettify(result);
}
@NotNull
private String statementToKotlin(Converter converter, String text) throws Exception {
String result = methodToKotlin(converter, "void main() {" + text + "}");
int pos = result.lastIndexOf("}");
result = result.substring(0, pos).replaceFirst("fun main\\(\\) : Unit \\{", "");
return prettify(result);
}
@NotNull
private String expressionToKotlin(Converter converter, String code) throws Exception {
String result = statementToKotlin(converter, "Object o =" + code + "}");
result = result.replaceFirst("var o : Any\\? =", "");
return prettify(result);
}
@NotNull
private static String prettify(@Nullable String code) {
if (code == null) {
return "";
}
return code
.trim()
.replaceAll("\r\n", "\n")
.replaceAll(" \n", "\n")
.replaceAll("\n ", "\n")
.replaceAll("\n+", "\n")
.replaceAll(" +", " ")
.trim()
;
}
}
@@ -1,110 +1,110 @@
/*
* Copyright 2010-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.jet.j2k;
import com.intellij.openapi.application.PathManager;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.io.FileFilter;
import java.io.FilenameFilter;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
* @author ignatov
*/
abstract class TestCaseBuilder {
@NotNull
private static final FilenameFilter emptyFilter = new FilenameFilter() {
@Override
public boolean accept(File file, String name) {
return true;
}
};
@NotNull
public static String getTestDataPathBase() {
return "testData";
}
public static String getHomeDirectory() {
return new File(PathManager.getResourceRoot(TestCaseBuilder.class, "/org/jetbrains/jet/TestCaseBuilder.class")).getParentFile().getParentFile().getParent();
}
public interface NamedTestFactory {
@NotNull
Test createTest(@NotNull String dataPath, @NotNull String name);
}
@NotNull
public static TestSuite suiteForDirectory(String baseDataDir, @NotNull final String dataPath, @NotNull NamedTestFactory factory) {
return suiteForDirectory(baseDataDir, dataPath, true, emptyFilter, factory);
}
@NotNull
private static TestSuite suiteForDirectory(String baseDataDir, @NotNull final String dataPath, boolean recursive, @NotNull final FilenameFilter filter, @NotNull NamedTestFactory factory) {
TestSuite suite = new TestSuite(dataPath);
final String extensionJava = ".jav";
final FilenameFilter extensionFilter = new FilenameFilter() {
@Override
public boolean accept(File dir, @NotNull String name) {
return name.endsWith(extensionJava);
}
};
FilenameFilter resultFilter;
if (filter != emptyFilter) {
resultFilter = new FilenameFilter() {
@Override
public boolean accept(File file, String s) {
return extensionFilter.accept(file, s) && filter.accept(file, s);
}
};
}
else {
resultFilter = extensionFilter;
}
File dir = new File(baseDataDir + dataPath);
FileFilter dirFilter = new FileFilter() {
@Override
public boolean accept(@NotNull File pathname) {
return pathname.isDirectory();
}
};
if (recursive) {
File[] files = dir.listFiles(dirFilter);
assert files != null : dir;
List<File> subdirs = Arrays.asList(files);
Collections.sort(subdirs);
for (File subdir : subdirs) {
suite.addTest(suiteForDirectory(baseDataDir, dataPath + "/" + subdir.getName(), recursive, filter, factory));
}
}
List<File> files = Arrays.asList(dir.listFiles(resultFilter));
Collections.sort(files);
for (File file : files) {
String fileName = file.getName();
assert fileName != null;
suite.addTest(factory.createTest(dataPath, fileName.substring(0, fileName.length() - extensionJava.length())));
}
return suite;
}
}
/*
* Copyright 2010-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.jet.j2k;
import com.intellij.openapi.application.PathManager;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.io.FileFilter;
import java.io.FilenameFilter;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
* @author ignatov
*/
abstract class TestCaseBuilder {
@NotNull
private static final FilenameFilter emptyFilter = new FilenameFilter() {
@Override
public boolean accept(File file, String name) {
return true;
}
};
@NotNull
public static String getTestDataPathBase() {
return "testData";
}
public static String getHomeDirectory() {
return new File(PathManager.getResourceRoot(TestCaseBuilder.class, "/org/jetbrains/jet/TestCaseBuilder.class")).getParentFile().getParentFile().getParent();
}
public interface NamedTestFactory {
@NotNull
Test createTest(@NotNull String dataPath, @NotNull String name);
}
@NotNull
public static TestSuite suiteForDirectory(String baseDataDir, @NotNull final String dataPath, @NotNull NamedTestFactory factory) {
return suiteForDirectory(baseDataDir, dataPath, true, emptyFilter, factory);
}
@NotNull
private static TestSuite suiteForDirectory(String baseDataDir, @NotNull final String dataPath, boolean recursive, @NotNull final FilenameFilter filter, @NotNull NamedTestFactory factory) {
TestSuite suite = new TestSuite(dataPath);
final String extensionJava = ".jav";
final FilenameFilter extensionFilter = new FilenameFilter() {
@Override
public boolean accept(File dir, @NotNull String name) {
return name.endsWith(extensionJava);
}
};
FilenameFilter resultFilter;
if (filter != emptyFilter) {
resultFilter = new FilenameFilter() {
@Override
public boolean accept(File file, String s) {
return extensionFilter.accept(file, s) && filter.accept(file, s);
}
};
}
else {
resultFilter = extensionFilter;
}
File dir = new File(baseDataDir + dataPath);
FileFilter dirFilter = new FileFilter() {
@Override
public boolean accept(@NotNull File pathname) {
return pathname.isDirectory();
}
};
if (recursive) {
File[] files = dir.listFiles(dirFilter);
assert files != null : dir;
List<File> subdirs = Arrays.asList(files);
Collections.sort(subdirs);
for (File subdir : subdirs) {
suite.addTest(suiteForDirectory(baseDataDir, dataPath + "/" + subdir.getName(), recursive, filter, factory));
}
}
List<File> files = Arrays.asList(dir.listFiles(resultFilter));
Collections.sort(files);
for (File file : files) {
String fileName = file.getName();
assert fileName != null;
suite.addTest(factory.createTest(dataPath, fileName.substring(0, fileName.length() - extensionJava.length())));
}
return suite;
}
}
@@ -1,29 +1,29 @@
package test;
import org.jetbrains.annotations.NotNull;
public class Test {
@NotNull String myStr = "String2";
public Test(@NotNull String str) {
myStr = str;
}
public void sout(@NotNull String str) {
System.out.println(str);
}
@NotNull
public String dummy(@NotNull String str) {
return str;
}
public void test() {
sout("String");
@NotNull String test = "String2";
sout(test);
sout(dummy(test));
new Test(test);
}
package test;
import org.jetbrains.annotations.NotNull;
public class Test {
@NotNull String myStr = "String2";
public Test(@NotNull String str) {
myStr = str;
}
public void sout(@NotNull String str) {
System.out.println(str);
}
@NotNull
public String dummy(@NotNull String str) {
return str;
}
public void test() {
sout("String");
@NotNull String test = "String2";
sout(test);
sout(dummy(test));
new Test(test);
}
}
@@ -1,20 +1,20 @@
package test
public open class Test(str : String) {
var myStr : String? = "String2"
public open fun sout(str : String) : Unit {
System.out?.println(str)
}
public open fun dummy(str : String) : String {
return str
}
public open fun test() : Unit {
sout("String")
var test : String = "String2"
sout(test)
sout(dummy(test))
Test(test)
}
{
myStr = str
}
package test
public open class Test(str : String) {
var myStr : String? = "String2"
public open fun sout(str : String) : Unit {
System.out?.println(str)
}
public open fun dummy(str : String) : String {
return str
}
public open fun test() : Unit {
sout("String")
var test : String = "String2"
sout(test)
sout(dummy(test))
Test(test)
}
{
myStr = str
}
}
@@ -1,6 +1,6 @@
open class Test() {
var str : String? = null
{
str = "Ola"
}
open class Test() {
var str : String? = null
{
str = "Ola"
}
}
@@ -1,8 +1,8 @@
open class Test() {
var str : String? = null
class object {
{
str = "Ola"
}
}
open class Test() {
var str : String? = null
class object {
{
str = "Ola"
}
}
}
@@ -1,4 +1,4 @@
var a : Double = 0
var b : Double = 0
var c : Double = 0
var a : Double = 0
var b : Double = 0
var c : Double = 0
var ds : DoubleArray? = doubleArray((a).toDouble(), (b).toDouble(), (c).toDouble())
@@ -1,4 +1,4 @@
var a : Int = 0
var b : Int = 0
var c : Int = 0
var a : Int = 0
var b : Int = 0
var c : Int = 0
var `is` : IntArray? = intArray(a, b, c)
@@ -1,2 +1,2 @@
fun fromArrayToCollection(a : Array<Foo?>?) : Unit {
fun fromArrayToCollection(a : Array<Foo?>?) : Unit {
}
@@ -1,9 +1,9 @@
import java.util.BitSet;
class Foo {
void foo(BitSet o) {
BitSet o2 = o;
int foo = 0;
foo = o2.size();
}
}
import java.util.BitSet;
class Foo {
void foo(BitSet o) {
BitSet o2 = o;
int foo = 0;
foo = o2.size();
}
}
@@ -1,8 +1,8 @@
import java.util.BitSet
open class Foo() {
open fun foo(o : BitSet?) : Unit {
var o2 : BitSet? = o
var foo : Int = 0
foo = o2?.size()!!
}
import java.util.BitSet
open class Foo() {
open fun foo(o : BitSet?) : Unit {
var o2 : BitSet? = o
var foo : Int = 0
foo = o2?.size()!!
}
}
+6 -6
View File
@@ -1,7 +1,7 @@
package demo
open class Test() {
open fun test() : Unit {
var i : Int? = Integer.valueOf(100)
var s : Short? = Short.valueOf(100)
}
package demo
open class Test() {
open fun test() : Unit {
var i : Int? = Integer.valueOf(100)
var s : Short? = Short.valueOf(100)
}
}
@@ -1,10 +1,10 @@
open class Library() {
class object {
val ourOut : java.io.PrintStream? = null
}
}
open class User() {
open fun main() : Unit {
Library.ourOut?.print()
}
open class Library() {
class object {
val ourOut : java.io.PrintStream? = null
}
}
open class User() {
open fun main() : Unit {
Library.ourOut?.print()
}
}
@@ -1,15 +1,15 @@
open class Library() {
class object {
open fun call() : Unit {
}
open fun getString() : String? {
return ""
}
}
}
open class User() {
open fun main() : Unit {
Library.call()
Library.getString()?.isEmpty()
}
open class Library() {
class object {
open fun call() : Unit {
}
open fun getString() : String? {
return ""
}
}
}
open class User() {
open fun main() : Unit {
Library.call()
Library.getString()?.isEmpty()
}
}
@@ -1,16 +1,16 @@
open class Library() {
open fun call() : Unit {
}
open fun getString() : String? {
return ""
}
}
open class User() {
open fun main() : Unit {
var lib : Library? = Library()
lib?.call()
lib?.getString()?.isEmpty()
Library().call()
Library().getString()?.isEmpty()
}
open class Library() {
open fun call() : Unit {
}
open fun getString() : String? {
return ""
}
}
open class User() {
open fun main() : Unit {
var lib : Library? = Library()
lib?.call()
lib?.getString()?.isEmpty()
Library().call()
Library().getString()?.isEmpty()
}
}
@@ -1,8 +1,8 @@
open class Library() {
public val myString : String? = null
}
open class User() {
open fun main() : Unit {
Library.myString?.isEmpty()
}
open class Library() {
public val myString : String? = null
}
open class User() {
open fun main() : Unit {
Library.myString?.isEmpty()
}
}
@@ -1,6 +1,6 @@
abstract class A() {
abstract fun callme() : Unit
open fun callmetoo() : Unit {
print("This is a concrete method.")
}
abstract class A() {
abstract fun callme() : Unit
open fun callmetoo() : Unit {
print("This is a concrete method.")
}
}
@@ -1,10 +1,10 @@
abstract class Shape() {
public var color : String? = null
public open fun setColor(c : String?) : Unit {
color = c
}
public open fun getColor() : String? {
return color
}
public abstract fun area() : Double
abstract class Shape() {
public var color : String? = null
public open fun setColor(c : String?) : Unit {
color = c
}
public open fun getColor() : String? {
return color
}
public abstract fun area() : Double
}
+1 -1
View File
@@ -1,2 +1,2 @@
open class Test() {
open class Test() {
}
@@ -1,8 +1,8 @@
class T() {
fun main() : Unit {
}
fun i() : Int {
}
fun s() : String? {
}
class T() {
fun main() : Unit {
}
fun i() : Int {
}
fun s() : String? {
}
}
@@ -1,4 +1,4 @@
class T() {
var a : String? = "abc"
var b : Int = 10
class T() {
var a : String? = "abc"
var b : Int = 10
}
@@ -1,5 +1,5 @@
class T() {
var a : String? = null
var b : String? = null
var c : String? = "abc"
class T() {
var a : String? = null
var b : String? = null
var c : String? = "abc"
}
+1 -1
View File
@@ -1,2 +1,2 @@
class A() {
class A() {
}
@@ -1,2 +1,2 @@
class A() : Base(), I {
class A() : Base(), I {
}
@@ -1,2 +1,2 @@
class A() : Base(), I0, I1, I2 {
class A() : Base(), I0, I1, I2 {
}
+1 -1
View File
@@ -1,2 +1,2 @@
class Test() {
class Test() {
}
@@ -1,2 +1,2 @@
class Entry<K, V>() {
class Entry<K, V>() {
}
@@ -1,4 +1,4 @@
class A() {
class B() {
}
class A() {
class B() {
}
}
@@ -1,6 +1,6 @@
class S() {
class object {
open class Inner() {
}
}
class S() {
class object {
open class Inner() {
}
}
}
@@ -1,2 +1,2 @@
open class Test() {
open class Test() {
}
@@ -1,8 +1,8 @@
class S() {
fun sB() : Boolean {
return true
}
class object {
var myI : Int = 10
}
class S() {
fun sB() : Boolean {
return true
}
class object {
var myI : Int = 10
}
}
@@ -1,7 +1,7 @@
class S() {
class object {
fun staticF() : Boolean {
return true
}
}
class S() {
class object {
fun staticF() : Boolean {
return true
}
}
}
@@ -1,10 +1,10 @@
class S() {
fun sB() : Boolean {
return true
}
class object {
fun sI() : Int {
return 1
}
}
class S() {
fun sB() : Boolean {
return true
}
class object {
fun sI() : Int {
return 1
}
}
}
@@ -1,2 +1,2 @@
private open class Test() {
private open class Test() {
}
@@ -1,2 +1,2 @@
protected open class Test() {
protected open class Test() {
}
@@ -1,2 +1,2 @@
public open class Test() {
public open class Test() {
}
@@ -1,2 +1,2 @@
class A() : Base() {
class A() : Base() {
}
@@ -1,10 +1,10 @@
class S() {
class object {
fun sB() : Boolean {
return true
}
fun sI() : Int {
return 1
}
}
class S() {
class object {
fun sB() : Boolean {
return true
}
fun sI() : Int {
return 1
}
}
}
+21 -21
View File
@@ -1,22 +1,22 @@
package demo
import java.util.HashMap
open class Test() {
class object {
open fun init() : Test {
val __ = Test()
return __
}
open fun init(s : String?) : Test {
val __ = Test()
return __
}
}
}
open class User() {
open fun main() : Unit {
var m : HashMap<Any?, Any?>? = HashMap(1)
var m2 : HashMap<Any?, Any?>? = HashMap(10)
var t1 : Test? = Test.init()
var t2 : Test? = Test.init("")
}
package demo
import java.util.HashMap
open class Test() {
class object {
open fun init() : Test {
val __ = Test()
return __
}
open fun init(s : String?) : Test {
val __ = Test()
return __
}
}
}
open class User() {
open fun main() : Unit {
var m : HashMap<Any?, Any?>? = HashMap(1)
var m2 : HashMap<Any?, Any?>? = HashMap(10)
var t1 : Test? = Test.init()
var t2 : Test? = Test.init("")
}
}
+3 -3
View File
@@ -1,4 +1,4 @@
public open class MyClass() {
private fun init(arg1 : Int, arg2 : Int, arg3 : Int) : Unit {
}
public open class MyClass() {
private fun init(arg1 : Int, arg2 : Int, arg3 : Int) : Unit {
}
}
@@ -1,4 +1,4 @@
(if (a.isEmpty())
0
else
(if (a.isEmpty())
0
else
1)
@@ -1,21 +1,21 @@
open class C(arg1 : Int, arg2 : Int, arg3 : Int) {
class object {
open fun init(arg1 : Int, arg2 : Int) : C {
val __ = C(arg1, arg2, 0)
return __
}
open fun init(arg1 : Int) : C {
val __ = C(arg1, 0, 0)
return __
}
}
}
public open class User() {
class object {
public open fun main() : Unit {
var c1 : C? = C(100, 100, 100)
var c2 : C? = C.init(100, 100)
var c3 : C? = C.init(100)
}
}
open class C(arg1 : Int, arg2 : Int, arg3 : Int) {
class object {
open fun init(arg1 : Int, arg2 : Int) : C {
val __ = C(arg1, arg2, 0)
return __
}
open fun init(arg1 : Int) : C {
val __ = C(arg1, 0, 0)
return __
}
}
}
public open class User() {
class object {
public open fun main() : Unit {
var c1 : C? = C(100, 100, 100)
var c2 : C? = C.init(100, 100)
var c3 : C? = C.init(100)
}
}
}
@@ -1,33 +1,33 @@
open class C(arg1 : Int) {
val myArg1 : Int
var myArg2 : Int = 0
var myArg3 : Int = 0
{
myArg1 = arg1
myArg2 = 0
myArg3 = 0
}
class object {
open fun init(arg1 : Int, arg2 : Int, arg3 : Int) : C {
val __ = C(arg1)
__.myArg2 = arg2
__.myArg3 = arg3
return __
}
open fun init(arg1 : Int, arg2 : Int) : C {
val __ = C(arg1)
__.myArg2 = arg2
__.myArg3 = 0
return __
}
}
}
public open class User() {
class object {
public open fun main() : Unit {
var c1 : C? = C.init(100, 100, 100)
var c2 : C? = C.init(100, 100)
var c3 : C? = C(100)
}
}
open class C(arg1 : Int) {
val myArg1 : Int
var myArg2 : Int = 0
var myArg3 : Int = 0
{
myArg1 = arg1
myArg2 = 0
myArg3 = 0
}
class object {
open fun init(arg1 : Int, arg2 : Int, arg3 : Int) : C {
val __ = C(arg1)
__.myArg2 = arg2
__.myArg3 = arg3
return __
}
open fun init(arg1 : Int, arg2 : Int) : C {
val __ = C(arg1)
__.myArg2 = arg2
__.myArg3 = 0
return __
}
}
}
public open class User() {
class object {
public open fun main() : Unit {
var c1 : C? = C.init(100, 100, 100)
var c2 : C? = C.init(100, 100)
var c3 : C? = C(100)
}
}
}
@@ -1,45 +1,45 @@
package org.test.customer
open class Customer(first : String?, last : String?) {
public val _firstName : String?
public val _lastName : String?
public open fun getFirstName() : String? {
return _firstName
}
public open fun getLastName() : String? {
return _lastName
}
private fun doSmthBefore() : Unit {
}
private fun doSmthAfter() : Unit {
}
{
doSmthBefore()
_firstName = first
_lastName = last
doSmthAfter()
}
}
open class CustomerBuilder() {
public var _firstName : String? = "Homer"
public var _lastName : String? = "Simpson"
public open fun WithFirstName(firstName : String?) : CustomerBuilder? {
_firstName = firstName
return this
}
public open fun WithLastName(lastName : String?) : CustomerBuilder? {
_lastName = lastName
return this
}
public open fun Build() : Customer? {
return Customer(_firstName, _lastName)
}
}
public open class User() {
class object {
public open fun main() : Unit {
var customer : Customer? = CustomerBuilder().WithFirstName("Homer")?.WithLastName("Simpson")?.Build()
System.out?.println(customer?.getFirstName())
System.out?.println(customer?.getLastName())
}
}
package org.test.customer
open class Customer(first : String?, last : String?) {
public val _firstName : String?
public val _lastName : String?
public open fun getFirstName() : String? {
return _firstName
}
public open fun getLastName() : String? {
return _lastName
}
private fun doSmthBefore() : Unit {
}
private fun doSmthAfter() : Unit {
}
{
doSmthBefore()
_firstName = first
_lastName = last
doSmthAfter()
}
}
open class CustomerBuilder() {
public var _firstName : String? = "Homer"
public var _lastName : String? = "Simpson"
public open fun WithFirstName(firstName : String?) : CustomerBuilder? {
_firstName = firstName
return this
}
public open fun WithLastName(lastName : String?) : CustomerBuilder? {
_lastName = lastName
return this
}
public open fun Build() : Customer? {
return Customer(_firstName, _lastName)
}
}
public open class User() {
class object {
public open fun main() : Unit {
var customer : Customer? = CustomerBuilder().WithFirstName("Homer")?.WithLastName("Simpson")?.Build()
System.out?.println(customer?.getFirstName())
System.out?.println(customer?.getLastName())
}
}
}
@@ -1,37 +1,37 @@
public open class Identifier<T>(_myName : T?, _myHasDollar : Boolean) {
private val myName : T? = null
private var myHasDollar : Boolean = false
private var myNullable : Boolean = true
public open fun getName() : T? {
return myName
}
{
myName = _myName
myHasDollar = _myHasDollar
}
class object {
public open fun init<T>(name : T?) : Identifier<T> {
val __ = Identifier(name, false)
return __
}
public open fun init<T>(name : T?, isNullable : Boolean) : Identifier<T> {
val __ = Identifier(name, false)
__.myNullable = isNullable
return __
}
public open fun init<T>(name : T?, hasDollar : Boolean, isNullable : Boolean) : Identifier<T> {
val __ = Identifier(name, hasDollar)
__.myNullable = isNullable
return __
}
}
}
public open class User() {
class object {
public open fun main() : Unit {
var i1 : Identifier<*>? = Identifier.init<String?>("name", false, true)
var i2 : Identifier<Any?>? = Identifier.init<String?>("name", false)
var i3 : Identifier<Any?>? = Identifier.init<String?>("name")
}
}
public open class Identifier<T>(_myName : T?, _myHasDollar : Boolean) {
private val myName : T? = null
private var myHasDollar : Boolean = false
private var myNullable : Boolean = true
public open fun getName() : T? {
return myName
}
{
myName = _myName
myHasDollar = _myHasDollar
}
class object {
public open fun init<T>(name : T?) : Identifier<T> {
val __ = Identifier(name, false)
return __
}
public open fun init<T>(name : T?, isNullable : Boolean) : Identifier<T> {
val __ = Identifier(name, false)
__.myNullable = isNullable
return __
}
public open fun init<T>(name : T?, hasDollar : Boolean, isNullable : Boolean) : Identifier<T> {
val __ = Identifier(name, hasDollar)
__.myNullable = isNullable
return __
}
}
}
public open class User() {
class object {
public open fun main() : Unit {
var i1 : Identifier<*>? = Identifier.init<String?>("name", false, true)
var i2 : Identifier<Any?>? = Identifier.init<String?>("name", false)
var i3 : Identifier<Any?>? = Identifier.init<String?>("name")
}
}
}
@@ -1,37 +1,37 @@
public open class Identifier(_myName : String?, _myHasDollar : Boolean) {
private val myName : String? = null
private var myHasDollar : Boolean = false
private var myNullable : Boolean = true
public open fun getName() : String? {
return myName
}
{
myName = _myName
myHasDollar = _myHasDollar
}
class object {
public open fun init(name : String?) : Identifier {
val __ = Identifier(name, false)
return __
}
public open fun init(name : String?, isNullable : Boolean) : Identifier {
val __ = Identifier(name, false)
__.myNullable = isNullable
return __
}
public open fun init(name : String?, hasDollar : Boolean, isNullable : Boolean) : Identifier {
val __ = Identifier(name, hasDollar)
__.myNullable = isNullable
return __
}
}
}
public open class User() {
class object {
public open fun main() : Unit {
var i1 : Identifier? = Identifier.init("name", false, true)
var i2 : Identifier? = Identifier.init("name", false)
var i3 : Identifier? = Identifier.init("name")
}
}
public open class Identifier(_myName : String?, _myHasDollar : Boolean) {
private val myName : String? = null
private var myHasDollar : Boolean = false
private var myNullable : Boolean = true
public open fun getName() : String? {
return myName
}
{
myName = _myName
myHasDollar = _myHasDollar
}
class object {
public open fun init(name : String?) : Identifier {
val __ = Identifier(name, false)
return __
}
public open fun init(name : String?, isNullable : Boolean) : Identifier {
val __ = Identifier(name, false)
__.myNullable = isNullable
return __
}
public open fun init(name : String?, hasDollar : Boolean, isNullable : Boolean) : Identifier {
val __ = Identifier(name, hasDollar)
__.myNullable = isNullable
return __
}
}
}
public open class User() {
class object {
public open fun main() : Unit {
var i1 : Identifier? = Identifier.init("name", false, true)
var i2 : Identifier? = Identifier.init("name", false)
var i3 : Identifier? = Identifier.init("name")
}
}
}
@@ -1,40 +1,40 @@
public open class Test(_myName : String?, _a : Boolean, _b : Double, _c : Float, _d : Long, _e : Int, _f : Short, _g : Char) {
private val myName : String?
private var a : Boolean = false
private var b : Double = 0.toDouble()
private var c : Float = 0.toFloat()
private var d : Long = 0
private var e : Int = 0
private var f : Short = 0
private var g : Char = ' '
{
myName = _myName
a = _a
b = _b
c = _c
d = _d
e = _e
f = _f
g = _g
}
class object {
public open fun init() : Test {
val __ = Test(null, false, 0.toDouble(), 0.toFloat(), 0, 0, 0, ' ')
return __
}
public open fun init(name : String?) : Test {
val __ = Test(foo(name), false, 0.toDouble(), 0.toFloat(), 0, 0, 0, ' ')
return __
}
open fun foo(n : String?) : String? {
return ""
}
}
}
public open class User() {
class object {
public open fun main() : Unit {
var t : Test? = Test.init("name")
}
}
public open class Test(_myName : String?, _a : Boolean, _b : Double, _c : Float, _d : Long, _e : Int, _f : Short, _g : Char) {
private val myName : String?
private var a : Boolean = false
private var b : Double = 0.toDouble()
private var c : Float = 0.toFloat()
private var d : Long = 0
private var e : Int = 0
private var f : Short = 0
private var g : Char = ' '
{
myName = _myName
a = _a
b = _b
c = _c
d = _d
e = _e
f = _f
g = _g
}
class object {
public open fun init() : Test {
val __ = Test(null, false, 0.toDouble(), 0.toFloat(), 0, 0, 0, ' ')
return __
}
public open fun init(name : String?) : Test {
val __ = Test(foo(name), false, 0.toDouble(), 0.toFloat(), 0, 0, 0, ' ')
return __
}
open fun foo(n : String?) : String? {
return ""
}
}
}
public open class User() {
class object {
public open fun main() : Unit {
var t : Test? = Test.init("name")
}
}
}
@@ -1,3 +1,3 @@
val k : Int
val l : Int
val k : Int
val l : Int
val m : Int
@@ -1,3 +1,3 @@
var k : Int
var l : Int
var k : Int
var l : Int
var m : Int
@@ -1,6 +1,6 @@
do
{
var i : Int = 1
i = i + 1
}
do
{
var i : Int = 1
i = i + 1
}
while (a > b)
@@ -1,4 +1,4 @@
do
{
}
do
{
}
while (true)
@@ -1,3 +1,3 @@
do
i = i + 1
do
i = i + 1
while (true)
@@ -1,3 +1,3 @@
do
return 1
do
return 1
while (true)
+13 -13
View File
@@ -1,14 +1,14 @@
package demo
enum class MyEnum(_color : Int) {
RED : MyEnum(10)
BLUE : MyEnum(20)
private val color : Int
public fun getColor() : Int {
return color
}
{
color = _color
}
public fun name() : String { return "" }
public fun order() : Int { return 0 }
package demo
enum class MyEnum(_color : Int) {
RED : MyEnum(10)
BLUE : MyEnum(20)
private val color : Int
public fun getColor() : Int {
return color
}
{
color = _color
}
public fun name() : String { return "" }
public fun order() : Int { return 0 }
}
+3 -3
View File
@@ -1,4 +1,4 @@
enum class A {
public fun name() : String { return "" }
public fun order() : Int { return 0 }
enum class A {
public fun name() : String { return "" }
public fun order() : Int { return 0 }
}
@@ -1,4 +1,4 @@
enum class A : I {
public fun name() : String { return "" }
public fun order() : Int { return 0 }
enum class A : I {
public fun name() : String { return "" }
public fun order() : Int { return 0 }
}
@@ -1,4 +1,4 @@
enum class A : I0, I1, I2 {
public fun name() : String { return "" }
public fun order() : Int { return 0 }
enum class A : I0, I1, I2 {
public fun name() : String { return "" }
public fun order() : Int { return 0 }
}
@@ -1,6 +1,6 @@
enum class E {
I
private var name : String? = null
public fun name() : String { return "" }
public fun order() : Int { return 0 }
enum class E {
I
private var name : String? = null
public fun name() : String { return "" }
public fun order() : Int { return 0 }
}
@@ -1,16 +1,16 @@
enum class Color(c : Int) {
WHITE : Color(21)
BLACK : Color(22)
RED : Color(23)
YELLOW : Color(24)
BLUE : Color(25)
private var code : Int = 0
public fun getCode() : Int {
return code
}
{
code = c
}
public fun name() : String { return "" }
public fun order() : Int { return 0 }
enum class Color(c : Int) {
WHITE : Color(21)
BLACK : Color(22)
RED : Color(23)
YELLOW : Color(24)
BLUE : Color(25)
private var code : Int = 0
public fun getCode() : Int {
return code
}
{
code = c
}
public fun name() : String { return "" }
public fun order() : Int { return 0 }
}
@@ -1,4 +1,4 @@
enum class Test {
public fun name() : String { return "" }
public fun order() : Int { return 0 }
enum class Test {
public fun name() : String { return "" }
public fun order() : Int { return 0 }
}
@@ -1,12 +1,12 @@
enum class Color {
WHITE
BLACK
RED
YELLOW
BLUE
override fun toString() : String? {
return "COLOR"
}
public fun name() : String { return "" }
public fun order() : Int { return 0 }
enum class Color {
WHITE
BLACK
RED
YELLOW
BLUE
override fun toString() : String? {
return "COLOR"
}
public fun name() : String { return "" }
public fun order() : Int { return 0 }
}
@@ -1,12 +1,12 @@
package demo
enum class Color(c : Int) {
private var code : Int = 0
public fun getCode() : Int {
return code
}
{
code = c
}
public fun name() : String { return "" }
public fun order() : Int { return 0 }
package demo
enum class Color(c : Int) {
private var code : Int = 0
public fun getCode() : Int {
return code
}
{
code = c
}
public fun name() : String { return "" }
public fun order() : Int { return 0 }
}
+3 -3
View File
@@ -1,4 +1,4 @@
private enum class Test {
public fun name() : String { return "" }
public fun order() : Int { return 0 }
private enum class Test {
public fun name() : String { return "" }
public fun order() : Int { return 0 }
}
@@ -1,4 +1,4 @@
protected enum class Test {
public fun name() : String { return "" }
public fun order() : Int { return 0 }
protected enum class Test {
public fun name() : String { return "" }
public fun order() : Int { return 0 }
}
+3 -3
View File
@@ -1,4 +1,4 @@
public enum class Test {
public fun name() : String { return "" }
public fun order() : Int { return 0 }
public enum class Test {
public fun name() : String { return "" }
public fun order() : Int { return 0 }
}
@@ -1,12 +1,12 @@
enum class Color : Runnable {
WHITE
BLACK
RED
YELLOW
BLUE
public override fun run() : Unit {
System.out?.println("name()=" + name() + ", toString()=" + toString())
}
public fun name() : String { return "" }
public fun order() : Int { return 0 }
enum class Color : Runnable {
WHITE
BLACK
RED
YELLOW
BLUE
public override fun run() : Unit {
System.out?.println("name()=" + name() + ", toString()=" + toString())
}
public fun name() : String { return "" }
public fun order() : Int { return 0 }
}
@@ -1,8 +1,8 @@
enum class Coin {
PENNY
NICKEL
DIME
QUARTER
public fun name() : String { return "" }
public fun order() : Int { return 0 }
enum class Coin {
PENNY
NICKEL
DIME
QUARTER
public fun name() : String { return "" }
public fun order() : Int { return 0 }
}
@@ -1,6 +1,6 @@
open class Base() {
private var myFirst : String? = null
}
open class Child() : Base() {
private var mySecond : String? = null
open class Base() {
private var myFirst : String? = null
}
open class Child() : Base() {
private var mySecond : String? = null
}
@@ -1,3 +1,3 @@
open class C() {
var f : Foo? = null
open class C() {
var f : Foo? = null
}
@@ -1,3 +1,3 @@
open class C() {
private var f : Foo? = null
open class C() {
private var f : Foo? = null
}
@@ -1,3 +1,3 @@
open class C() {
protected var f : Foo? = null
open class C() {
protected var f : Foo? = null
}
+2 -2
View File
@@ -1,3 +1,3 @@
open class C() {
public var f : Foo? = null
open class C() {
public var f : Foo? = null
}
+2 -2
View File
@@ -1,3 +1,3 @@
open class C() {
val f : Foo = Foo(1, 2)
open class C() {
val f : Foo = Foo(1, 2)
}
+2 -2
View File
@@ -1,3 +1,3 @@
open class C() {
var f : Foo? = Foo(1, 2)
open class C() {
var f : Foo? = Foo(1, 2)
}
@@ -1,3 +1,3 @@
open class C() {
var f : Foo? = null
open class C() {
var f : Foo? = null
}
@@ -1,9 +1,9 @@
package demo
import kotlin.compatibility.*
open class Test() {
open fun test() : Unit {
var i : Int? = 10
var j : Int? = 10
System.out?.println(i + j)
}
package demo
import kotlin.compatibility.*
open class Test() {
open fun test() : Unit {
var i : Int? = 10
var j : Int? = 10
System.out?.println(i + j)
}
}
@@ -1,3 +1,3 @@
package test
class C() {
package test
class C() {
}
@@ -1,4 +1,4 @@
class A() {
}
class B() {
class A() {
}
class B() {
}
@@ -1,3 +1,3 @@
package test
import ast
package test
import ast
import ast2
@@ -1,3 +1,3 @@
package test
import ast
package test
import ast
import ast2
@@ -1,3 +1,3 @@
package test
open class C() {
package test
open class C() {
}
@@ -1,3 +1,3 @@
package test
import ast
package test
import ast
import ast2
@@ -1,10 +1,10 @@
{
init()
while (condition())
{
body()
{
update()
}
}
{
init()
while (condition())
{
body()
{
update()
}
}
}
@@ -1,4 +1,4 @@
var array : IntArray? = IntArray(10)
for (i in 0..10) {
array[i] = i
var array : IntArray? = IntArray(10)
for (i in 0..10) {
array[i] = i
}
@@ -1,4 +1,4 @@
var array : IntArray? = IntArray(10)
for (i in 0..10 - 1) {
array[i] = i
var array : IntArray? = IntArray(10)
for (i in 0..10 - 1) {
array[i] = i
}
@@ -1,4 +1,4 @@
var array : IntArray? = IntArray(10)
for (i in 0..10 - 1) {
array[i] = i
var array : IntArray? = IntArray(10)
for (i in 0..10 - 1) {
array[i] = i
}
@@ -1,14 +1,14 @@
{
var i : Int = 0
while (i < 0)
{
{
var i : Int = 1
i++
}
{
j++
i++
}
}
{
var i : Int = 0
while (i < 0)
{
{
var i : Int = 1
i++
}
{
j++
i++
}
}
}
@@ -1,12 +1,12 @@
{
var i : Int = 0
while (i < 0)
{
{
}
{
j++
i++
}
}
{
var i : Int = 0
while (i < 0)
{
{
}
{
j++
i++
}
}
}
@@ -1,11 +1,11 @@
{
var i : Int = 0
while (i < 0)
{
return i
{
j++
i++
}
}
{
var i : Int = 0
while (i < 0)
{
return i
{
j++
i++
}
}
}
@@ -1,5 +1,5 @@
for (n : Node? in list)
{
var i : Int = 1
i++
for (n : Node? in list)
{
var i : Int = 1
i++
}
@@ -1,3 +1,3 @@
for (n : Node? in list)
{
for (n : Node? in list)
{
}
@@ -1,2 +1,2 @@
for (n : Node? in list)
for (n : Node? in list)
i++
@@ -1,2 +1,2 @@
for (n : Node? in list)
for (n : Node? in list)
return n
@@ -1,35 +1,35 @@
package test
open class Test() : Base() {
public override fun hashCode() : Int {
return super.hashCode()
}
public override fun equals(o : Any?) : Boolean {
return super.equals(o)
}
protected override fun clone() : Any? {
return super.clone()
}
public override fun toString() : String? {
return super.toString()
}
protected override fun finalize() : Unit {
super.finalize()
}
}
open class Base() {
public open fun hashCode() : Int {
return System.identityHashCode(this)
}
public open fun equals(o : Any?) : Boolean {
return this.identityEquals(o)
}
protected open fun clone() : Any? {
return super.clone()
}
public open fun toString() : String? {
return getJavaClass<Base>.getName() + '@' + Integer.toHexString(hashCode())
}
protected open fun finalize() : Unit {
super.finalize()
}
package test
open class Test() : Base() {
public override fun hashCode() : Int {
return super.hashCode()
}
public override fun equals(o : Any?) : Boolean {
return super.equals(o)
}
protected override fun clone() : Any? {
return super.clone()
}
public override fun toString() : String? {
return super.toString()
}
protected override fun finalize() : Unit {
super.finalize()
}
}
open class Base() {
public open fun hashCode() : Int {
return System.identityHashCode(this)
}
public open fun equals(o : Any?) : Boolean {
return this.identityEquals(o)
}
protected open fun clone() : Any? {
return super.clone()
}
public open fun toString() : String? {
return getJavaClass<Base>.getName() + '@' + Integer.toHexString(hashCode())
}
protected open fun finalize() : Unit {
super.finalize()
}
}
@@ -1,5 +1,5 @@
package demo
class Final() {
fun test() : Unit {
}
package demo
class Final() {
fun test() : Unit {
}
}
+7 -7
View File
@@ -1,8 +1,8 @@
open class A() {
open fun a() : Unit {
}
}
class B() : A() {
override fun a() : Unit {
}
open class A() {
open fun a() : Unit {
}
}
class B() : A() {
override fun a() : Unit {
}
}
@@ -1,12 +1,12 @@
open class A() {
open fun foo() : Unit {
}
}
open class B() : A() {
override fun foo() : Unit {
}
}
open class C() : B() {
override fun foo() : Unit {
}
open class A() {
open fun foo() : Unit {
}
}
open class B() : A() {
override fun foo() : Unit {
}
}
open class C() : B() {
override fun foo() : Unit {
}
}
@@ -1,18 +1,18 @@
package test
open class Test() {
public open fun hashCode() : Int {
return System.identityHashCode(this)
}
public open fun equals(o : Any?) : Boolean {
return this.identityEquals(o)
}
protected open fun clone() : Any? {
return super.clone()
}
public open fun toString() : String? {
return getJavaClass<Test>.getName() + '@' + Integer.toHexString(hashCode())
}
protected open fun finalize() : Unit {
super.finalize()
}
package test
open class Test() {
public open fun hashCode() : Int {
return System.identityHashCode(this)
}
public open fun equals(o : Any?) : Boolean {
return this.identityEquals(o)
}
protected open fun clone() : Any? {
return super.clone()
}
public open fun toString() : String? {
return getJavaClass<Test>.getName() + '@' + Integer.toHexString(hashCode())
}
protected open fun finalize() : Unit {
super.finalize()
}
}
@@ -1,6 +1,6 @@
package demo
open class Test() {
open fun test(vararg var args : Any?) : Unit {
args = array<Int?>(1, 2, 3)
}
package demo
open class Test() {
open fun test(vararg var args : Any?) : Unit {
args = array<Int?>(1, 2, 3)
}
}
@@ -1,7 +1,7 @@
package demo
open class Test() {
open fun test(var i : Int) : Int {
i = 10
return i + 20
}
package demo
open class Test() {
open fun test(var i : Int) : Int {
i = 10
return i + 20
}
}

Some files were not shown because too many files have changed in this diff Show More