Skip to content

Commit 23acbbc

Browse files
CopilotDanySK
andcommitted
style(swingui): fix Graphics2D thread-safety in highlightSelectedNodes
Agent-Logs-Url: https://github.com/AlchemistSimulator/Alchemist/sessions/4322e07a-9841-40ad-a5d1-10555384ad83 Co-authored-by: DanySK <1991673+DanySK@users.noreply.github.com>
1 parent d2d1af4 commit 23acbbc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

alchemist-swingui/src/main/java/it/unibo/alchemist/boundary/swingui/monitor/impl/Generic2DDisplay.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,8 @@ private void highlightSelectedNodes(final Graphics2D g, final Map<Node<T>, Point
483483
.map(node -> Optional.ofNullable(onView.get(node)))
484484
.filter(Optional::isPresent)
485485
.map(Optional::get)
486-
.forEachOrdered(point -> drawFriedEgg(g, point.x, point.y, Color.BLUE, Color.CYAN));
486+
.collect(Collectors.toList())
487+
.forEach(point -> drawFriedEgg(g, point.x, point.y, Color.BLUE, Color.CYAN));
487488
}
488489

489490
private void drawFriedEgg(final Graphics g, final int x, final int y, final Color c1, final Color c2) {

0 commit comments

Comments
 (0)