You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by be...@apache.org on 2022/09/26 16:49:32 UTC

[incubator-streampark] branch dev updated: [Improve] code format and translate comments to EN. (#1699)

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

benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev by this push:
     new f12c2ffa6 [Improve] code format and translate comments to EN. (#1699)
f12c2ffa6 is described below

commit f12c2ffa6572e9440e277ad9ae5a91a135cfc72f
Author: Shaokang Lv <lv...@hotmail.com>
AuthorDate: Tue Sep 27 00:49:24 2022 +0800

    [Improve] code format and translate comments to EN. (#1699)
---
 .../org/apache/streampark/common/util/SystemPropertyUtils.scala    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/streampark-common/src/main/scala/org/apache/streampark/common/util/SystemPropertyUtils.scala b/streampark-common/src/main/scala/org/apache/streampark/common/util/SystemPropertyUtils.scala
index d957f8d52..211e04683 100644
--- a/streampark-common/src/main/scala/org/apache/streampark/common/util/SystemPropertyUtils.scala
+++ b/streampark-common/src/main/scala/org/apache/streampark/common/util/SystemPropertyUtils.scala
@@ -107,12 +107,13 @@ object SystemPropertyUtils extends Logger {
   }
 
   def setAppHome(key: String, clazz: Class[_]): Unit = {
-    if (get(key) == null) { //获取主类所在jar位置或class位置.
+    if (get(key) == null) { // get the jar location or class location where the main class is located
       val jarOrClassPath = clazz.getProtectionDomain.getCodeSource.getLocation.getPath
       val file = new File(jarOrClassPath)
-      val appHome: String = if (jarOrClassPath.endsWith("jar")) { //jar包运行,将app.home定位到当前jar所在位置上两层目录
+      // jar package run, locate app.home to the current jar location two levels above the directory
+      val appHome: String = if (jarOrClassPath.endsWith("jar")) {
         file.getParentFile.getParentFile.getPath
-      } else { //开发阶段,将app.home定位到target下.
+      } else { // during the development phase, locate the app.home under target.
         file.getPath.replaceAll("classes/$", "")
       }
       SystemPropertyUtils.set(key, appHome)