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

mikexue 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 a9f5ad7de fix issue2542
     new 9b9a50614 Merge pull request #2560 from jonyangx/issue2542
a9f5ad7de is described below

commit a9f5ad7de57218f130bc4f0ec4bc91ca7e682b06
Author: jonyangx <[email protected]>
AuthorDate: Sun Dec 11 22:56:14 2022 +0800

    fix issue2542
---
 .../eventmesh/trace/pinpoint/config/PinpointConfiguration.java      | 6 +++---
 1 file changed, 3 insertions(+), 3 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 dcf3eba63..14d2254b9 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
@@ -34,7 +34,6 @@ import org.apache.commons.lang3.StringUtils;
 
 import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileReader;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -86,7 +85,7 @@ public final class PinpointConfiguration {
         applicationName = properties.getProperty(APPLICATION_NAME_KEY);
         if (StringUtils.isBlank(applicationName)) {
             applicationName = 
Optional.ofNullable(System.getProperty(APPLICATION_NAME))
-                    .orElse(System.getenv(APPLICATION_NAME));
+                    .orElseGet(() -> System.getenv(APPLICATION_NAME));
         }
 
         requireNonNull(applicationName, String.format("%s can not be null", 
APPLICATION_NAME_KEY));
@@ -114,7 +113,8 @@ public final class PinpointConfiguration {
         URL resource = 
PinpointConfiguration.class.getClassLoader().getResource(CONFIG_FILE);
         if (resource != null) {
             try (InputStream inputStream = resource.openStream();
-                 BufferedReader reader = new BufferedReader(new 
InputStreamReader(inputStream, StandardCharsets.UTF_8))) {
+                 BufferedReader reader = new BufferedReader(
+                         new InputStreamReader(inputStream, 
StandardCharsets.UTF_8))) {
                 if (inputStream.available() > 0) {
                     properties.load(reader);
                 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to