New J2K: Print function modifiers and relax method visibility in test
This commit is contained in:
committed by
Ilya Kirillov
parent
fe180138f3
commit
13a63e421b
@@ -136,7 +136,9 @@ class NewCodeBuilder {
|
||||
}
|
||||
|
||||
override fun visitKtFunction(ktFunction: JKKtFunction) {
|
||||
printer.print("fun ", ktFunction.name.value, "(")
|
||||
printer.printIndent()
|
||||
ktFunction.modifierList.accept(this)
|
||||
printer.printWithNoIndent(" fun ", ktFunction.name.value, "(")
|
||||
for (parameter in ktFunction.parameters) {
|
||||
if (parameter != ktFunction.parameters.first()) {
|
||||
printer.printWithNoIndent(", ")
|
||||
|
||||
@@ -116,7 +116,7 @@ abstract class AbstractJavaToKotlinConverterSingleFileTest : AbstractJavaToKotli
|
||||
|
||||
private fun statementToKotlin(text: String, settings: ConverterSettings, project: Project): String {
|
||||
val funBody = text.lines().joinToString(separator = "\n", transform = { " $it" })
|
||||
val result = methodToKotlin("void main() {\n$funBody\n}", settings, project)
|
||||
val result = methodToKotlin("public void main() {\n$funBody\n}", settings, project)
|
||||
|
||||
return result
|
||||
.substringBeforeLast("}")
|
||||
|
||||
Reference in New Issue
Block a user