Run formatter in function context for converted expression and statements

This commit is contained in:
Nikolay Krasko
2014-04-25 15:39:48 +04:00
parent f11e35f988
commit 13dce4dd11
75 changed files with 331 additions and 343 deletions
@@ -1 +1 @@
assert(true) {"string details"}
assert(true) { "string details" }
@@ -1 +1 @@
assert(true) {"string details"}
assert(true) { "string details" }
@@ -1,4 +1,4 @@
(if (a.isEmpty())
0
0
else
1)
1)
@@ -1,4 +1,4 @@
(if (a.isEmpty())
0
0
else
1)
1)
@@ -1,6 +1,4 @@
do
{
val i = 1
i = i + 1
}
while (a > b)
do {
val i = 1
i = i + 1
} while (a > b)
@@ -1,6 +1,4 @@
do
{
var i: Int = 1
i = i + 1
}
while (a > b)
do {
var i: Int = 1
i = i + 1
} while (a > b)
@@ -1,3 +1,2 @@
do
{}
while (true)
do {
} while (true)
@@ -1,3 +1,2 @@
do
{}
while (true)
do {
} while (true)
@@ -1,3 +1,3 @@
do
i = i + 1
i = i + 1
while (true)
@@ -1,3 +1,3 @@
do
i = i + 1
i = i + 1
while (true)
@@ -1,3 +1,3 @@
do
return 1
return 1
while (true)
@@ -1,3 +1,3 @@
do
return 1
return 1
while (true)
@@ -1,10 +1,9 @@
{
init()
while (condition())
{
body()
{
update()
}
}
init()
while (condition()) {
body()
{
update()
}
}
}
@@ -1,10 +1,9 @@
{
init()
while (condition())
{
body()
{
update()
}
}
init()
while (condition()) {
body()
{
update()
}
}
}
@@ -1,4 +1,4 @@
val array = IntArray(10)
for (i in 0..10) {
array[i] = i
array[i] = i
}
+1 -1
View File
@@ -1,4 +1,4 @@
var array: IntArray? = IntArray(10)
for (i in 0..10) {
array[i] = i
array[i] = i
}
@@ -1,4 +1,4 @@
val array = IntArray(10)
for (i in 0..10 - 1) {
array[i] = i
array[i] = i
}
+1 -1
View File
@@ -1,4 +1,4 @@
var array: IntArray? = IntArray(10)
for (i in 0..10 - 1) {
array[i] = i
array[i] = i
}
@@ -1,4 +1,4 @@
val array = IntArray(10)
for (i in 0..10 - 1) {
array[i] = i
array[i] = i
}
+1 -1
View File
@@ -1,4 +1,4 @@
var array: IntArray? = IntArray(10)
for (i in 0..10 - 1) {
array[i] = i
array[i] = i
}
@@ -1,14 +1,13 @@
{
val i = 0
while (i <0)
{
{
val i = 1
i++
}
{
j++
i++
}
}
val i = 0
while (i < 0) {
{
val i = 1
i++
}
{
j++
i++
}
}
}
@@ -1,14 +1,13 @@
{
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,11 +1,10 @@
{
val i = 0
while (i <0)
{
{}
{
j++
i++
}
}
val i = 0
while (i < 0) {
{ }
{
j++
i++
}
}
}
@@ -1,11 +1,10 @@
{
var i: Int = 0
while (i <0)
{
{}
{
j++
i++
}
}
var i: Int = 0
while (i < 0) {
{ }
{
j++
i++
}
}
}
@@ -1,10 +1,9 @@
{
init()
while (true)
{
body()
{
update()
}
}
init()
while (true) {
body()
{
update()
}
}
}
@@ -1,10 +1,9 @@
{
init()
while (true)
{
body()
{
update()
}
}
init()
while (true) {
body()
{
update()
}
}
}
@@ -1,9 +1,8 @@
{
while (condition())
{
body()
{
update()
}
}
while (condition()) {
body()
{
update()
}
}
}
@@ -1,9 +1,8 @@
{
while (condition())
{
body()
{
update()
}
}
while (condition()) {
body()
{
update()
}
}
}
@@ -1,7 +1,6 @@
{
init()
while (condition())
{
body()
}
init()
while (condition()) {
body()
}
}
@@ -1,7 +1,6 @@
{
init()
while (condition())
{
body()
}
init()
while (condition()) {
body()
}
}
@@ -1,11 +1,10 @@
{
val i = 0
while (i <0)
{
return i
{
j++
i++
}
}
val i = 0
while (i < 0) {
return i
{
j++
i++
}
}
}
+8 -9
View File
@@ -1,11 +1,10 @@
{
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,4 @@
for (n in list)
{
val i = 1
i++
for (n in list) {
val i = 1
i++
}
@@ -1,5 +1,4 @@
for (n in list)
{
var i: Int = 1
i++
for (n in list) {
var i: Int = 1
i++
}
@@ -1,2 +1,2 @@
for (n in list)
{}
for (n in list) {
}
@@ -1,2 +1,2 @@
for (n in list)
{}
for (n in list) {
}
@@ -1,2 +1,2 @@
for (n in list)
i++
i++
@@ -1,2 +1,2 @@
for (n in list)
i++
i++
@@ -1,2 +1,2 @@
for (n in list)
return n
return n
@@ -1,2 +1,2 @@
for (n in list)
return n
return n
@@ -1,4 +1,3 @@
if (1 > 0)
{}
else
{}
if (1 > 0) {
} else {
}
@@ -1,4 +1,3 @@
if (1 > 0)
{}
else
{}
if (1 > 0) {
} else {
}
@@ -1,9 +1,6 @@
if (1 > 0)
{
val n = 1
return n
}
else
{
return 0
if (1 > 0) {
val n = 1
return n
} else {
return 0
}
@@ -1,9 +1,6 @@
if (1 > 0)
{
var n: Int = 1
return n
}
else
{
return 0
if (1 > 0) {
var n: Int = 1
return n
} else {
return 0
}
@@ -1,4 +1,4 @@
if (true)
return 1
return 1
else
return 0
return 0
@@ -1,4 +1,4 @@
if (true)
return 1
return 1
else
return 0
return 0
@@ -1,5 +1,4 @@
if (1 > 0)
{
val n = 1
return n
if (1 > 0) {
val n = 1
return n
}
@@ -1,5 +1,4 @@
if (1 > 0)
{
var n: Int = 1
return n
if (1 > 0) {
var n: Int = 1
return n
}
@@ -1,2 +1,2 @@
//element
//file
import java.util.Arrays;
@@ -1,3 +1,3 @@
//element
//file
import java.util.Arrays;
import java.util.concurrent.ArrayBlockingQueue;
@@ -1,16 +1,14 @@
@test for (i in 0..max) {
val n = substring.length()
val j = i
val k = 0
while (n-- != 0)
{
if (searchMe.charAt(j++) != substring.charAt(k++))
{
continue@test
}
}
foundIt = true
break@test
val n = substring.length()
val j = i
val k = 0
while (n-- != 0) {
if (searchMe.charAt(j++) != substring.charAt(k++)) {
continue@test
}
}
foundIt = true
break@test
}
System.out.println((if (foundIt)
"Found it"
@@ -1,16 +1,14 @@
@test for (i in 0..max) {
var n: Int = substring.length()
var j: Int = i
var k: Int = 0
while (n-- != 0)
{
if (searchMe.charAt(j++) != substring.charAt(k++))
{
continue@test
}
}
foundIt = true
break@test
var n: Int = substring.length()
var j: Int = i
var k: Int = 0
while (n-- != 0) {
if (searchMe.charAt(j++) != substring.charAt(k++)) {
continue@test
}
}
foundIt = true
break@test
}
System.out?.println((if (foundIt)
"Found it"
@@ -1,5 +1,5 @@
object : Runnable() {
override fun run() {
System.out.println("Run")
}
override fun run() {
System.out.println("Run")
}
}
@@ -1,5 +1,5 @@
object : Runnable() {
override fun run() {
System.out?.println("Run")
}
override fun run() {
System.out?.println("Run")
}
}
@@ -1,3 +1,3 @@
val s = null
if (!s.isEmpty())
{}
if (!s.isEmpty()) {
}
@@ -1,3 +1,3 @@
var s: String? = null
if (!s?.isEmpty()!!)
{}
if (!s?.isEmpty()!!) {
}
@@ -1,3 +1,3 @@
synchronized (s) {
doSomething(s)
doSomething(s)
}
@@ -1,3 +1,3 @@
synchronized (s) {
doSomething(s)
doSomething(s)
}
@@ -1,14 +1,9 @@
try
{
callMethod(params)
}
catch (e : Exception) {
println(1)
}
catch (e : IOException) {
println(0)
}
finally
{
println(3)
try {
callMethod(params)
} catch (e: Exception) {
println(1)
} catch (e: IOException) {
println(0)
} finally {
println(3)
}
@@ -1,14 +1,9 @@
try
{
callMethod(params)
}
catch (e : Exception) {
println(1)
}
catch (e : IOException) {
println(0)
}
finally
{
println(3)
try {
callMethod(params)
} catch (e: Exception) {
println(1)
} catch (e: IOException) {
println(0)
} finally {
println(3)
}
@@ -1,10 +1,7 @@
try
{}
catch (e : Exception) {
println(1)
}
catch (e : IOException) {
println(0)
}
finally
{}
try {
} catch (e: Exception) {
println(1)
} catch (e: IOException) {
println(0)
} finally {
}
@@ -1,10 +1,7 @@
try
{}
catch (e : Exception) {
println(1)
}
catch (e : IOException) {
println(0)
}
finally
{}
try {
} catch (e: Exception) {
println(1)
} catch (e: IOException) {
println(0)
} finally {
}
@@ -1,12 +1,8 @@
try
{}
catch (e : Exception) {
println(1)
}
catch (e : IOException) {
println(0)
}
finally
{
println(3)
try {
} catch (e: Exception) {
println(1)
} catch (e: IOException) {
println(0)
} finally {
println(3)
}
@@ -1,12 +1,8 @@
try
{}
catch (e : Exception) {
println(1)
}
catch (e : IOException) {
println(0)
}
finally
{
println(3)
try {
} catch (e: Exception) {
println(1)
} catch (e: IOException) {
println(0)
} finally {
println(3)
}
@@ -1,8 +1,6 @@
try
{}
catch (e : Exception) {
println(1)
}
catch (e : IOException) {
println(0)
try {
} catch (e: Exception) {
println(1)
} catch (e: IOException) {
println(0)
}
@@ -1,8 +1,6 @@
try
{}
catch (e : Exception) {
println(1)
}
catch (e : IOException) {
println(0)
try {
} catch (e: Exception) {
println(1)
} catch (e: IOException) {
println(0)
}
@@ -1,5 +1,4 @@
while (a > b)
{
val i = 1
i = i + 1
while (a > b) {
val i = 1
i = i + 1
}
@@ -1,5 +1,4 @@
while (a > b)
{
var i: Int = 1
i = i + 1
while (a > b) {
var i: Int = 1
i = i + 1
}
@@ -1,2 +1,2 @@
while (true)
{}
while (true) {
}
@@ -1,2 +1,2 @@
while (true)
{}
while (true) {
}
@@ -1,2 +1,2 @@
while (true)
i = i + 1
i = i + 1
@@ -1,2 +1,2 @@
while (true)
i = i + 1
i = i + 1
@@ -1,2 +1,2 @@
while (true)
return 1
return 1
@@ -1,2 +1,2 @@
while (true)
return 1
return 1