Skip to content

Commit 801dbba

Browse files
committed
Remove workaround for KT-28237
1 parent 8d8b6eb commit 801dbba

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

kotlinx-coroutines-core/jvm/src/internal/StackTraceRecovery.kt

+2-14
Original file line numberDiff line numberDiff line change
@@ -161,28 +161,16 @@ private fun <E : Throwable> recoveryDisabled(exception: E) =
161161

162162
private fun createStackTrace(continuation: CoroutineStackFrame): ArrayDeque<StackTraceElement> {
163163
val stack = ArrayDeque<StackTraceElement>()
164-
continuation.getStackTraceElement()?.let { stack.add(sanitize(it)) }
164+
continuation.getStackTraceElement()?.let { stack.add(it) }
165165

166166
var last = continuation
167167
while (true) {
168168
last = (last as? CoroutineStackFrame)?.callerFrame ?: break
169-
last.getStackTraceElement()?.let { stack.add(sanitize(it)) }
169+
last.getStackTraceElement()?.let { stack.add(it) }
170170
}
171171
return stack
172172
}
173173

174-
/**
175-
* @suppress
176-
*/
177-
@InternalCoroutinesApi
178-
public fun sanitize(element: StackTraceElement): StackTraceElement {
179-
if (!element.className.contains('/')) {
180-
return element
181-
}
182-
// KT-28237: STE generated with debug metadata contains '/' as separators in FQN, while Java contains dots
183-
return StackTraceElement(element.className.replace('/', '.'), element.methodName, element.fileName, element.lineNumber)
184-
}
185-
186174
/**
187175
* @suppress
188176
*/

kotlinx-coroutines-debug/src/CoroutineInfo.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
package kotlinx.coroutines.debug
88

99
import kotlinx.coroutines.*
10-
import kotlinx.coroutines.internal.sanitize
1110
import kotlin.coroutines.*
1211
import kotlin.coroutines.jvm.internal.*
1312

@@ -64,7 +63,7 @@ public data class CoroutineInfo internal constructor(
6463
var frame: CoroutineStackFrame? = lastObservedFrame ?: return emptyList()
6564
val result = ArrayList<StackTraceElement>()
6665
while (frame != null) {
67-
frame.getStackTraceElement()?.let { result.add(sanitize(it)) }
66+
frame.getStackTraceElement()?.let { result.add(it) }
6867
frame = frame.callerFrame
6968
}
7069
return result

0 commit comments

Comments
 (0)