You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by jo...@apache.org on 2022/12/04 13:17:45 UTC

[incubator-eventmesh] branch master updated: update buffered close (#2456)

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

jonyang 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 3c2bd5b81 update buffered close (#2456)
3c2bd5b81 is described below

commit 3c2bd5b8144d516f73d55a1737f9a4018b4922ca
Author: weihubeats <we...@163.com>
AuthorDate: Sun Dec 4 21:17:41 2022 +0800

    update buffered close (#2456)
---
 .../apache/eventmesh/trace/zipkin/config/ZipkinConfiguration.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/eventmesh-trace-plugin/eventmesh-trace-zipkin/src/main/java/org/apache/eventmesh/trace/zipkin/config/ZipkinConfiguration.java b/eventmesh-trace-plugin/eventmesh-trace-zipkin/src/main/java/org/apache/eventmesh/trace/zipkin/config/ZipkinConfiguration.java
index f9142ccec..40d30bb7d 100644
--- a/eventmesh-trace-plugin/eventmesh-trace-zipkin/src/main/java/org/apache/eventmesh/trace/zipkin/config/ZipkinConfiguration.java
+++ b/eventmesh-trace-plugin/eventmesh-trace-zipkin/src/main/java/org/apache/eventmesh/trace/zipkin/config/ZipkinConfiguration.java
@@ -29,6 +29,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.Properties;
 
 import com.google.common.base.Preconditions;
@@ -65,7 +66,7 @@ public class ZipkinConfiguration {
     private void initializeConfig() {
         String eventMeshZipkinIPStr = properties.getProperty(ZipkinConstants.KEY_ZIPKIN_IP);
         Preconditions.checkState(StringUtils.isNotEmpty(eventMeshZipkinIPStr),
-                                 String.format("%s error", ZipkinConstants.KEY_ZIPKIN_IP));
+            String.format("%s error", ZipkinConstants.KEY_ZIPKIN_IP));
         eventMeshZipkinIP = StringUtils.deleteWhitespace(eventMeshZipkinIPStr);
 
         String eventMeshZipkinPortStr = properties.getProperty(ZipkinConstants.KEY_ZIPKIN_PORT);
@@ -77,9 +78,10 @@ public class ZipkinConfiguration {
     private void loadProperties() {
         URL resource = ZipkinConfiguration.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("Load zipkin.properties file from classpath error", e);


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