mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
IDEA-351461 Avoid dependency to kotlin in intellij.java.rt
GitOrigin-RevId: 47de00f563e617874f173f22e4d7a6ba11fd1254
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fc02ceff22
commit
5cdcf70555
@@ -34,6 +34,5 @@
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="library" name="JUnit4" level="project" />
|
||||
<orderEntry type="library" name="kotlinx-coroutines-core" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -4,14 +4,14 @@ package com.intellij.rt.debugger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings({"KotlinInternalInJava", "UnnecessaryFullyQualifiedName"})
|
||||
public final class CoroutinesDebugHelper {
|
||||
public static long[] getCoroutinesRunningOnCurrentThread(kotlinx.coroutines.debug.internal.DebugProbesImpl instance) {
|
||||
public static long[] getCoroutinesRunningOnCurrentThread(Object debugProbes) throws ReflectiveOperationException {
|
||||
Thread currentThread = Thread.currentThread();
|
||||
List<Long> coroutinesIds = new ArrayList<>();
|
||||
for (kotlinx.coroutines.debug.internal.DebugCoroutineInfo info : instance.dumpCoroutinesInfo()) {
|
||||
if (info.getLastObservedThread() == currentThread) {
|
||||
coroutinesIds.add(info.getSequenceNumber());
|
||||
List infos = (List)invoke(debugProbes, "dumpCoroutinesInfo");
|
||||
for (Object info : infos) {
|
||||
if (invoke(info, "getLastObservedThread") == currentThread) {
|
||||
coroutinesIds.add((Long)invoke(info, "getSequenceNumber"));
|
||||
}
|
||||
}
|
||||
long[] res = new long[coroutinesIds.size()];
|
||||
@@ -20,4 +20,8 @@ public final class CoroutinesDebugHelper {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private static Object invoke(Object object, String methodName) throws ReflectiveOperationException {
|
||||
return object.getClass().getMethod(methodName).invoke(object);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user