Skip to content

Commit 5058081

Browse files
committed
Improve handling of stacktrace tests on JDK 8
Before, the tests only knew that the `park` native method was moved to `jdk.internal.misc.Unsafe` from `sun.misc.Unsafe`. However, in JDK 11, there is no `sun.misc.Unsafe` at all, it seems that it has been moved completely. This change is beneficial for this feature set because BlockHound puts its `$$BlockHound$$_park` method to `sun.misc.Unsafe` or to `jdk.internal.misc.Unsafe` depending on the JDK version. Also, judging by BlockHound's code https://github.com/reactor/BlockHound/blob/091d7b139479b1c41eea59baa23389d673fdf73b/agent/src/main/java/reactor/blockhound/BlockHound.java#L177-L187, `forkAndExec` had been moved, too, but it is not used in tests.
1 parent d1e4798 commit 5058081

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kotlinx-coroutines-debug/test/StracktraceUtils.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public fun String.trimStackTrace(): String =
1313
.replace(Regex("#[0-9]+"), "")
1414
.replace(Regex("(?<=\tat )[^\n]*/"), "")
1515
.replace(Regex("\t"), "")
16-
.replace("sun.misc.Unsafe.park", "jdk.internal.misc.Unsafe.park") // JDK8->JDK11
16+
.replace("sun.misc.Unsafe.", "jdk.internal.misc.Unsafe.") // JDK8->JDK11
1717
.applyBackspace()
1818

1919
public fun String.applyBackspace(): String {

0 commit comments

Comments
 (0)