From 3cc19fbf3206f4f16738d61b5724f4f76065730d Mon Sep 17 00:00:00 2001 From: Henry Coles Date: Mon, 19 Apr 2021 17:02:24 +0100 Subject: [PATCH] use standard charsets --- .../java/org/pitest/mutationtest/config/ReportOptions.java | 3 ++- .../org/pitest/mutationtest/incremental/FileWriterFactory.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pitest-entry/src/main/java/org/pitest/mutationtest/config/ReportOptions.java b/pitest-entry/src/main/java/org/pitest/mutationtest/config/ReportOptions.java index 0360ff616..a620400c5 100644 --- a/pitest-entry/src/main/java/org/pitest/mutationtest/config/ReportOptions.java +++ b/pitest-entry/src/main/java/org/pitest/mutationtest/config/ReportOptions.java @@ -22,6 +22,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -487,7 +488,7 @@ public Optional createHistoryReader() { if (this.historyInputLocation.exists() && (this.historyInputLocation.length() > 0)) { return Optional.ofNullable(new InputStreamReader(new FileInputStream( - this.historyInputLocation), "UTF-8")); + this.historyInputLocation), StandardCharsets.UTF_8)); } return Optional.empty(); } catch (final IOException ex) { diff --git a/pitest-entry/src/main/java/org/pitest/mutationtest/incremental/FileWriterFactory.java b/pitest-entry/src/main/java/org/pitest/mutationtest/incremental/FileWriterFactory.java index a978b0b71..e1402463c 100644 --- a/pitest-entry/src/main/java/org/pitest/mutationtest/incremental/FileWriterFactory.java +++ b/pitest-entry/src/main/java/org/pitest/mutationtest/incremental/FileWriterFactory.java @@ -5,6 +5,7 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; +import java.nio.charset.StandardCharsets; import org.pitest.util.Unchecked; @@ -23,7 +24,7 @@ public PrintWriter create() { try { if (this.writer == null) { this.writer = new PrintWriter(new OutputStreamWriter( - new FileOutputStream(this.file), "UTF-8")); + new FileOutputStream(this.file), StandardCharsets.UTF_8)); } return this.writer;