From 9316fb56259bf9b30bb214d69587551e50b1c264 Mon Sep 17 00:00:00 2001 From: Laszlo Kishalmi Date: Sun, 12 Nov 2023 16:18:08 -0800 Subject: [PATCH] Fix ConcurrentModificationException in TestMethodController --- .../modules/gsf/testrunner/ui/api/TestMethodController.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ide/gsf.testrunner.ui/src/org/netbeans/modules/gsf/testrunner/ui/api/TestMethodController.java b/ide/gsf.testrunner.ui/src/org/netbeans/modules/gsf/testrunner/ui/api/TestMethodController.java index aa8b742a6e3a..85e064ee7d4d 100644 --- a/ide/gsf.testrunner.ui/src/org/netbeans/modules/gsf/testrunner/ui/api/TestMethodController.java +++ b/ide/gsf.testrunner.ui/src/org/netbeans/modules/gsf/testrunner/ui/api/TestMethodController.java @@ -62,12 +62,10 @@ private static void setTestMethodsImpl(StyledDocument doc, List meth doc.putProperty(TestMethodAnnotation.DOCUMENT_ANNOTATION_LINES_KEY, annotationLines); } - Map removed = new HashMap<>(annotations); - - methods.forEach(tm -> removed.remove(tm)); - Set added = new HashSet<>(methods); + Map removed = new HashMap<>(annotations); + removed.keySet().removeAll(added); added.removeAll(annotations.keySet()); for (TestMethod method : added) {