From ae7ce6b1cb072412a46599d78eb83390c85f5e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Tue, 16 Aug 2022 22:53:20 -0300 Subject: [PATCH] Remove usage of CloseShieldWriter - commons-io was a test dependency, not worth including it for a single use of a single class --- .../sourceforge/pmd/cli/commands/internal/PmdCommand.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdCommand.java b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdCommand.java index 27fe33595b..1cbe8f9377 100644 --- a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdCommand.java +++ b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdCommand.java @@ -12,7 +12,6 @@ import java.util.TreeSet; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.apache.commons.io.output.CloseShieldWriter; import org.slf4j.LoggerFactory; import org.slf4j.event.Level; @@ -322,8 +321,9 @@ public class PmdCommand extends AbstractAnalysisPmdSubcommand { // TODO get specified report format from config final TimingReportRenderer renderer = new TextTimingReportRenderer(); - // Use a CloseShieldWriter to avoid closing STDERR - try (final Writer writer = new CloseShieldWriter(new OutputStreamWriter(System.err))) { + try { + // No try-with-resources, do not want to close STDERR + final Writer writer = new OutputStreamWriter(System.err); renderer.render(timingReport, writer); } catch (final IOException e) { pmdReporter.errorEx("Error producing benchmark report", e);