chore: resolve Kotlin warnings

This commit is contained in:
SpaiR committed 2024-08-18 10:58:06 +03:00
1 parent 400dc4d2bc
commit 1bc1eb5b36
2 files changed
+10 -1

No files matched your search

@@ -9,7 +9,7 @@ import spoon.reflect.declaration.ModifierKind
import kotlin.math.absoluteValue
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 {
@@ -9,6 +9,7 @@ import spoon.reflect.factory.Factory
import spoon.reflect.reference.CtTypeParameterReference
import tool.generator.ast.Decl
import tool.generator.ast.DeclContainer
import java.util.*
const val A_NAME_BINDING_SOURCE = "BindingSource"
const val A_NAME_BINDING_METHOD = "BindingMethod"
@@ -186,3 +187,11 @@ fun Collection<Decl>.filterDecls0(filter: (Decl) -> Boolean): Collection<Decl> {
filter0(this)
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()) }
}