Skip to content

Commit

Permalink
Enforce braces in some of the code gen (duckduckgo#3159)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/1202552961248957/1204371051688547/f

### Description
See asana task

### Steps to test this PR
NA, just CI
  • Loading branch information
aitorvs authored May 15, 2023
1 parent b3f9271 commit d290f69
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,10 @@ class ContributesRemoteFeatureCodeGenerator : CodeGenerator {
.addParameter("name", String::class)
.addCode(
"""
return kotlin.runCatching { this.javaClass.getDeclaredMethod(name) }.getOrNull()?.let { m ->
m.invoke(this)
} as Toggle
val toggle = kotlin.runCatching {
this.javaClass.getDeclaredMethod(name)
}.getOrNull()?.invoke(this) as Toggle
return toggle
""".trimIndent(),
)
.returns(Toggle::class)
Expand Down

0 comments on commit d290f69

Please sign in to comment.