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:18:28 UTC
[incubator-eventmesh] branch master updated: update buffered close (#2455)
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 c507166e5 update buffered close (#2455)
c507166e5 is described below
commit c507166e5c64c81593c679870efe744b235d5683
Author: weihubeats <we...@163.com>
AuthorDate: Sun Dec 4 21:18:22 2022 +0800
update buffered close (#2455)
---
.../java/org/apache/eventmesh/common/utils/PropertiesUtils.java | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/PropertiesUtils.java b/eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/PropertiesUtils.java
index ee7e9b0b5..733687211 100644
--- a/eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/PropertiesUtils.java
+++ b/eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/PropertiesUtils.java
@@ -81,16 +81,13 @@ public class PropertiesUtils {
*/
public static void loadPropertiesWhenFileExist(Properties properties, String path, Charset cs) throws IOException {
Preconditions.checkNotNull(properties, "Properties can not be null");
-
File file = new File(path);
if (!file.exists()) {
return;
}
-
- try (FileInputStream reader = new FileInputStream(file)) {
- properties.load(new BufferedReader(new InputStreamReader(reader, cs)));
- } catch (IOException e) {
- throw e;
+ try (BufferedReader reader = new BufferedReader(
+ new InputStreamReader(new FileInputStream(file), cs))) {
+ properties.load(reader);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org