From 07adfa218c0f396d88550d0123434e1da2382d09 Mon Sep 17 00:00:00 2001 From: 0verEngineer Date: Wed, 24 May 2023 19:47:30 +0200 Subject: [PATCH] Update CHANGELOG.md and makes activeProblems thread save --- CHANGELOG.md | 3 +++ .../java/org/overengineer/inlineproblems/ProblemManager.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d4dee6..66b4138 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Some performance improvements - Description for the listeners in the settings - Configurable delay for the manual scan listener +- Support for new EAP versions ### Changed - HighlightProblemListener is now deprecated @@ -18,6 +19,8 @@ ### Fixed - Some possible null pointer exceptions - invokeLater queuing issue of MarkupModelListener if used with the only one problem per line feature +- Cache of activeProblems is now thread safe +- CustomSeverity bugs that leads to useless problem updates ## [0.4.2] diff --git a/src/main/java/org/overengineer/inlineproblems/ProblemManager.java b/src/main/java/org/overengineer/inlineproblems/ProblemManager.java index 5ea4903..fd99b27 100644 --- a/src/main/java/org/overengineer/inlineproblems/ProblemManager.java +++ b/src/main/java/org/overengineer/inlineproblems/ProblemManager.java @@ -32,7 +32,7 @@ public void removeProblem(InlineProblem problem) { inlineDrawer.undrawErrorLineHighlight(problem); inlineDrawer.undrawInlineProblemLabel(problem); - if (!activeProblems.remove(problem)) { + if (!Collections.synchronizedList(activeProblems).remove(problem)) { logger.warn("Removal of problem failed, resetting"); resetForEditor(problem.getTextEditor().getEditor()); return; @@ -73,7 +73,7 @@ private void addProblemPrivate(InlineProblem problem) { inlineDrawer.drawProblemLabel(problem, drawDetails); inlineDrawer.drawProblemLineHighlight(problem, drawDetails); - activeProblems.add(problem); + Collections.synchronizedList(activeProblems).add(problem); } public boolean shouldProblemBeIgnored(int severity) {