You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by ti...@apache.org on 2022/11/28 09:36:43 UTC

[incubator-eventmesh] branch master updated: [ISSUE #2239] fix BufferedReader doesn't auto-close bug and use UTF-8. (#2289)

This is an automated email from the ASF dual-hosted git repository.

timcross pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new 7599168e0 [ISSUE #2239] fix BufferedReader doesn't auto-close bug and use UTF-8. (#2289)
7599168e0 is described below

commit 7599168e0564d02d9987ed9679863aebe3b71bf5
Author: LPxz <li...@163.com>
AuthorDate: Mon Nov 28 17:36:37 2022 +0800

    [ISSUE #2239] fix BufferedReader doesn't auto-close bug and use UTF-8. (#2289)
---
 .../eventmesh/trace/pinpoint/config/PinpointConfiguration.java      | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/eventmesh-trace-plugin/eventmesh-trace-pinpoint/src/main/java/org/apache/eventmesh/trace/pinpoint/config/PinpointConfiguration.java b/eventmesh-trace-plugin/eventmesh-trace-pinpoint/src/main/java/org/apache/eventmesh/trace/pinpoint/config/PinpointConfiguration.java
index 5b0dd6667..8d44d0d0a 100644
--- a/eventmesh-trace-plugin/eventmesh-trace-pinpoint/src/main/java/org/apache/eventmesh/trace/pinpoint/config/PinpointConfiguration.java
+++ b/eventmesh-trace-plugin/eventmesh-trace-pinpoint/src/main/java/org/apache/eventmesh/trace/pinpoint/config/PinpointConfiguration.java
@@ -39,6 +39,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.net.URL;
+import java.nio.charset.StandardCharsets;
 import java.util.Optional;
 import java.util.Properties;
 
@@ -113,9 +114,10 @@ public final class PinpointConfiguration {
     private static void loadProperties() {
         URL resource = PinpointConfiguration.class.getClassLoader().getResource(CONFIG_FILE);
         if (resource != null) {
-            try (InputStream inputStream = resource.openStream()) {
+            try (InputStream inputStream = resource.openStream();
+                BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) {
                 if (inputStream.available() > 0) {
-                    properties.load(new BufferedReader(new InputStreamReader(inputStream)));
+                    properties.load(reader);
                 }
             } catch (IOException e) {
                 throw new RuntimeException(String.format("Load %s file from classpath error", CONFIG_FILE));


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org