From 2cc621f1884c8276731d1e6d51557313994c43fa Mon Sep 17 00:00:00 2001 From: jojo Date: Fri, 25 Sep 2020 21:29:29 +0200 Subject: [PATCH] Fix UnsupportedOperationException on addAll() --- .../src/de/steamwar/bausystem/tracer/ShowManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/tracer/ShowManager.java b/BauSystem_Main/src/de/steamwar/bausystem/tracer/ShowManager.java index db5075c..9514990 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/tracer/ShowManager.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/tracer/ShowManager.java @@ -81,7 +81,7 @@ public class ShowManager { public void addSelection(int id) { if (showSelection == ShowSelection.ALL) return; if (showSelection == ShowSelection.NONE) showSelection = ShowSelection.SELECTIVE; - selected.addAll(TraceManager.getFrame(id)); + TraceManager.getFrame(id).forEach(i -> selected.add(i)); if (selected.size() == TraceManager.getAllTraces().size()) { showSelection = ShowSelection.ALL; clear(); @@ -91,7 +91,7 @@ public class ShowManager { public void removeSelection(int id) { if (showSelection == ShowSelection.NONE) return; if (showSelection == ShowSelection.ALL) selected = TraceManager.getAllTraces(); - selected.removeAll(TraceManager.getFrame(id)); + TraceManager.getFrame(id).forEach(i -> selected.remove(i)); showSelection = ShowSelection.SELECTIVE; if (selected.isEmpty()) showSelection = ShowSelection.NONE; }