From 6d3faa7b9d8e8cb166aef49cc707889ffb1e2465 Mon Sep 17 00:00:00 2001 From: Egor Ushakov Date: Wed, 5 Sep 2018 11:57:49 +0300 Subject: [PATCH] extra check for JRE-937 --- .../debugger/actions/ThreadDumpAction.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/ThreadDumpAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/ThreadDumpAction.java index 84902b7cc0e5..78c838d184fd 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/ThreadDumpAction.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/ThreadDumpAction.java @@ -157,14 +157,17 @@ public class ThreadDumpAction extends AnAction implements AnAction.TransparentUp hasEmptyStack = frames.size() == 0; final TIntObjectHashMap> lockedAt = new TIntObjectHashMap<>(); - if (vmProxy.canGetMonitorFrameInfo() && vmProxy.canBeModified()) { - for (MonitorInfo info : threadReference.ownedMonitorsAndFrames()) { - final int stackDepth = info.stackDepth(); - List monitors; - if ((monitors = lockedAt.get(stackDepth)) == null) { - lockedAt.put(stackDepth, monitors = new SmartList<>()); + if (vmProxy.canGetMonitorFrameInfo()) { + for (Object m : threadReference.ownedMonitorsAndFrames()) { + if (m instanceof MonitorInfo) { // see JRE-937 + MonitorInfo info = (MonitorInfo)m; + final int stackDepth = info.stackDepth(); + List monitors; + if ((monitors = lockedAt.get(stackDepth)) == null) { + lockedAt.put(stackDepth, monitors = new SmartList<>()); + } + monitors.add(info.monitor()); } - monitors.add(info.monitor()); } }