Java to Kotlin converter: minor corrections after code review

This commit is contained in:
Valentin Kipyatkov
2014-06-06 20:49:18 +04:00
parent f652c50c8c
commit e947ad7294
32 changed files with 145 additions and 56 deletions
@@ -3,6 +3,6 @@ class C {
private String s = "";
void foo() {
s = null
s = null;
}
}
@@ -3,6 +3,6 @@ class C {
private String s = null;
void foo() {
s = "x"
s = "x";
}
}
@@ -3,6 +3,6 @@ class C {
private void foo(String s){}
void bar() {
foo(null)
foo(null);
}
}
@@ -3,6 +3,6 @@ class C {
private void foo(String s){}
void bar(boolean b) {
foo(b ? "a" : null)
foo(b ? "a" : null);
}
}
@@ -6,7 +6,7 @@ interface I {
class C {
void foo(I i) {
if (i.getString() == null) {
println("null")
println("null");
}
}
}
@@ -2,10 +2,10 @@
class C {
String foo(boolean b) {
if (b) {
return "abc"
return "abc";
}
else {
return null
return null;
}
}
}
@@ -1,9 +1,6 @@
import java.lang.Override;
import java.lang.String;
//file
interface Getter {
String get()
String get();
}
class C {
@@ -1,5 +1,3 @@
import java.lang.Override
trait Getter {
public fun get(): String
}
@@ -0,0 +1,10 @@
//file
class C {
String foo() {
class Local {
String foo() { return null; }
};
new Local().foo();
return "";
}
}
@@ -1,6 +1,6 @@
//file
class C {
String foo(boolean b) {
return b ? "abc" : null
return b ? "abc" : null;
}
}
@@ -1,6 +1,6 @@
//method
void foo(String s) {
if (s != null) {
zoo(s)
zoo(s);
}
}
@@ -3,6 +3,6 @@
void foo(boolean b) {
String s = "abc";
if (b) {
s = null
s = null;
}
}
@@ -1,8 +1,8 @@
//method
// !specifyLocalVariableTypeByDefault: true
void foo() {
String s = bar()
String s = bar();
if (s != null) {
zoo(s)
zoo(s);
}
}
@@ -3,6 +3,6 @@
void foo(boolean b) {
String s = null;
if (b) {
s = "abc"
s = "abc";
}
}