Conversion from Java on paste: post processing of code really works

This commit is contained in:
Valentin Kipyatkov
2015-04-03 02:48:39 +03:00
parent 2227452e7a
commit d0637ccaf4
17 changed files with 219 additions and 111 deletions
@@ -0,0 +1,6 @@
fun foo(o: Any) {
if (o is String) {
val l = o.length()
}
somethingElse()
}
@@ -0,0 +1,7 @@
class C {
void foo(Object o) {
<selection> if (o instanceof String) {
int l = ((String) o).length();
}
</selection> }
}
@@ -0,0 +1,3 @@
fun foo(o: Any) {
<caret> somethingElse()
}
@@ -0,0 +1,5 @@
fun foo(o: Any) {
if (o !is String) return
val l = o.length()
somethingElse(o as String/* we should not remove this cast because it's not in pasted range*/)
}
@@ -0,0 +1,6 @@
class C {
void foo(Object o) {
<selection> if (!(o instanceof String)) return
int l = ((String) o).length();
</selection> }
}
@@ -0,0 +1,3 @@
fun foo(o: Any) {
<caret> somethingElse(o as String/* we should not remove this cast because it's not in pasted range*/)
}