diff --git a/src/main/java/io/jenkins/plugins/coverage/CoverageProcessor.java b/src/main/java/io/jenkins/plugins/coverage/CoverageProcessor.java index 5fe148a77..e64b63432 100644 --- a/src/main/java/io/jenkins/plugins/coverage/CoverageProcessor.java +++ b/src/main/java/io/jenkins/plugins/coverage/CoverageProcessor.java @@ -33,6 +33,7 @@ import java.io.PrintStream; import java.nio.file.Files; import java.nio.file.Paths; +import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.LinkedList; @@ -289,10 +290,10 @@ private HealthReport processThresholds(Map resultTask = new LinkedList<>(); for (Map.Entry> results : adapterWithResults.entrySet()) { - // make local threshold over global threshold List thresholds = results.getKey().getThresholds(); if (thresholds != null) { + thresholds = new ArrayList<>(thresholds); for (Threshold t : globalThresholds) { if (!thresholds.contains(t)) { thresholds.add(t);