chore: resolve Kotlin warnings
This commit is contained in:
2 files changed
+10
-1
No files matched your search
@@ -9,7 +9,7 @@ import spoon.reflect.declaration.ModifierKind
|
|||||||
import kotlin.math.absoluteValue
|
import kotlin.math.absoluteValue
|
||||||
|
|
||||||
private fun createStaticStructFieldName(method: CtMethod<*>): String {
|
private fun createStaticStructFieldName(method: CtMethod<*>): String {
|
||||||
return "_${method.simpleName.toUpperCase()}_${method.parameters.hashCode().absoluteValue}"
|
return "_${method.simpleName.uppercase()}_${method.parameters.hashCode().absoluteValue}"
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createStaticStructField(typeName: String, fieldName: String): String {
|
private fun createStaticStructField(typeName: String, fieldName: String): String {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import spoon.reflect.factory.Factory
|
|||||||
import spoon.reflect.reference.CtTypeParameterReference
|
import spoon.reflect.reference.CtTypeParameterReference
|
||||||
import tool.generator.ast.Decl
|
import tool.generator.ast.Decl
|
||||||
import tool.generator.ast.DeclContainer
|
import tool.generator.ast.DeclContainer
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
const val A_NAME_BINDING_SOURCE = "BindingSource"
|
const val A_NAME_BINDING_SOURCE = "BindingSource"
|
||||||
const val A_NAME_BINDING_METHOD = "BindingMethod"
|
const val A_NAME_BINDING_METHOD = "BindingMethod"
|
||||||
@@ -186,3 +187,11 @@ fun Collection<Decl>.filterDecls0(filter: (Decl) -> Boolean): Collection<Decl> {
|
|||||||
filter0(this)
|
filter0(this)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun String.capitalize(): String {
|
||||||
|
return replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun String.decapitalize(): String {
|
||||||
|
return replaceFirstChar { it.lowercase(Locale.getDefault()) }
|
||||||
|
}
|
||||||
Reference in new issue
Block a user