Skip to content

Commit 1106522

Browse files
committed
Fix kotlin java method name escape
1 parent 2bd3eb2 commit 1106522

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

templates/android/library/src/main/java/io/package/services/Service.kt.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class {{ service.name | caseUcfirst }}(client: Client) : Service(client) {
4343
{%~ if method.parameters.all | reduce((carry, param) => carry or not param.required) %}
4444
@JvmOverloads
4545
{%~ endif %}
46-
suspend fun {% if method.responseModel | hasGenericType(spec) %}{{ '<T>' | raw }} {% endif %}{{ method.name | caseCamel }}(
46+
suspend fun {% if method.responseModel | hasGenericType(spec) %}{{ '<T>' | raw }} {% endif %}{{ method.name | caseCamel | escapeKeyword }}(
4747
{%~ if method.type == "webAuth" %}
4848
activity: ComponentActivity,
4949
{%~ endif %}

templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class {{ service.name | caseUcfirst }}(client: Client) : Service(client) {
3636
@JvmOverloads
3737
{%~ endif %}
3838
@Throws({{ spec.title | caseUcfirst }}Exception::class)
39-
suspend fun {% if method.responseModel | hasGenericType(spec) %}{{ '<T>' | raw }} {% endif %}{{ method.name | caseCamel }}(
39+
suspend fun {% if method.responseModel | hasGenericType(spec) %}{{ '<T>' | raw }} {% endif %}{{ method.name | caseCamel | escapeKeyword }}(
4040
{%~ for parameter in method.parameters.all %}
4141
{{ parameter.name | caseCamel }}: {{ parameter | typeName }}{%~ if not parameter.required or parameter.nullable %}? = null{% endif %},
4242
{%~ endfor %}

tests/languages/android/Tests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public void test() throws IOException {
140140
writeToFile(ex.toString());
141141
}
142142

143-
general.enum(MockType.FIRST, new CoroutineCallback<>(this::writeMockResult));
143+
general.xenum(MockType.FIRST, new CoroutineCallback<>(this::writeMockResult));
144144

145145
try {
146146
general.error400();

tests/languages/android/Tests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class ServiceTest {
135135
writeToFile(ex.toString())
136136
}
137137

138-
mock = general.enum(MockType.FIRST)
138+
mock = general.xenum(MockType.FIRST)
139139
writeToFile(mock.result)
140140

141141
try {

0 commit comments

Comments
 (0)