elharo commented on code in PR #444:
URL: 
https://github.com/apache/maven-build-cache-extension/pull/444#discussion_r2725542991


##########
src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java:
##########
@@ -342,7 +342,7 @@ private boolean checkItemMatchesBaseline(ProjectsInputInfo 
baselineBuild, Digest
     private String getEffectivePom(Model prototype) throws IOException {
         ByteArrayOutputStream output = new ByteArrayOutputStream();
 
-        try (Writer writer = WriterFactory.newXmlWriter(output)) {
+        try (Writer writer = new OutputStreamWriter(output, 
StandardCharsets.UTF_8)) {
             new MavenXpp3Writer().write(writer, prototype);
 
             // normalize env specifics

Review Comment:
   we should really get rid of MavenXpp3Writer in the same PR since they're 
tied together



##########
src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java:
##########
@@ -342,7 +342,7 @@ private boolean checkItemMatchesBaseline(ProjectsInputInfo 
baselineBuild, Digest
     private String getEffectivePom(Model prototype) throws IOException {
         ByteArrayOutputStream output = new ByteArrayOutputStream();
 
-        try (Writer writer = WriterFactory.newXmlWriter(output)) {
+        try (Writer writer = new OutputStreamWriter(output, 
StandardCharsets.UTF_8)) {

Review Comment:
   you don't need a writer here at all. just write straight onto the output 
stream and let the other classes pick an encoding.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to