IDEA-374617 [debugger] Fix sporadic ConcurrentModificationException

Passing a mutable object probably wasn't the brightest idea.

GitOrigin-RevId: 144d09c18c4cf695087d0cf7220094b48fb160f6
This commit is contained in:
Alexander Kuznetsov
2025-06-18 10:03:39 +00:00
committed by intellij-monorepo-bot
parent b62cd2383d
commit 7734dbbd0d
3 changed files with 12 additions and 2 deletions
@@ -49,9 +49,10 @@ internal fun computeUiPresentation(
descriptor.exactRecursiveIndex.asDeferred().await()?.let { index ->
if (index > 0) {
container.append(" [$index]", SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES)
send(container.copy().apply {
append(" [$index]", SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES)
})
}
}
send(container)
close()
}.buffer(Channel.CONFLATED)
@@ -29,6 +29,7 @@ a:com.intellij.xdebugger.frame.XStackFrame
- append(com.intellij.ui.ColoredText):V
- append(java.lang.String,com.intellij.ui.SimpleTextAttributes):V
- append(java.lang.String,com.intellij.ui.SimpleTextAttributes,java.lang.Object):V
- f:copy():com.intellij.xdebugger.frame.XStackFrameUiPresentationContainer
- f:customizePresentation(com.intellij.ui.ColoredTextContainer):V
- f:getFragments():java.util.List
- f:getIcon():javax.swing.Icon
@@ -50,4 +50,12 @@ class XStackFrameUiPresentationContainer : ColoredTextContainer {
container.append(fragment, attrs)
}
}
fun copy(): XStackFrameUiPresentationContainer {
val copy = XStackFrameUiPresentationContainer()
copy.myIcon = myIcon
copy.myTooltipText = myTooltipText
copy.myFragments.addAll(myFragments)
return copy
}
}