Remove usage of CloseShieldWriter

- commons-io was a test dependency, not worth including it for a single use of a single class
This commit is contained in:
Juan Martín Sotuyo Dodero
2022-08-16 22:53:20 -03:00
parent 774f58f657
commit ae7ce6b1cb

View File

@ -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);