Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7746164

Browse files
committed
Kotlin: Don't give stack traces for fake labels
There might be a significant performance hit for it.
1 parent 9bd0391 commit 7746164

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

java/kotlin-extractor/src/main/kotlin/KotlinExtractorExtension.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,13 @@ fun doFile(invocationTrapFile: String, checkTrapIdentical: Boolean, logger: Logg
263263
}
264264

265265
fun <T> fakeLabel(): Label<T> {
266-
val sw = StringWriter()
267-
Exception().printStackTrace(PrintWriter(sw))
268-
println("Fake label from:\n$sw")
266+
if (true) {
267+
println("Fake label")
268+
} else {
269+
val sw = StringWriter()
270+
Exception().printStackTrace(PrintWriter(sw))
271+
println("Fake label from:\n$sw")
272+
}
269273
return Label(0)
270274
}
271275

0 commit comments

Comments
 (0)