You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2020/01/04 15:31:50 UTC

[GitHub] [incubator-dolphinscheduler] Jave-Chen opened a new pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Jave-Chen opened a new pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716
 
 
   ## What is the purpose of the pull request
   #1714 
   Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
   
   ## Brief change log
   1. Use try-with-resources with Socket, prepareStatement.
   2. Add connection.close() at executeFuncAndSql.
   3. Fix some code smell.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] codecov-io commented on issue #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716#issuecomment-570896005
 
 
   # [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=h1) Report
   > Merging [#1716](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=desc) into [dev](https://codecov.io/gh/apache/incubator-dolphinscheduler/commit/cfe174293f1a0076340a9ebd84955a6206692257?src=pr&el=desc) will **increase** coverage by `0.33%`.
   > The diff coverage is `0%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/graphs/tree.svg?width=650&token=bv9iXXRLi9&height=150&src=pr)](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##              dev    #1716      +/-   ##
   ==========================================
   + Coverage   17.15%   17.48%   +0.33%     
   ==========================================
     Files         285      285              
     Lines       13900    13912      +12     
     Branches     2267     2275       +8     
   ==========================================
   + Hits         2385     2433      +48     
   + Misses      11240    11206      -34     
   + Partials      275      273       -2
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...lphinscheduler/server/worker/task/sql/SqlTask.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL3dvcmtlci90YXNrL3NxbC9TcWxUYXNrLmphdmE=) | `0% <0%> (ø)` | :arrow_up: |
   | [...dolphinscheduler/api/utils/FourLetterWordMain.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3V0aWxzL0ZvdXJMZXR0ZXJXb3JkTWFpbi5qYXZh) | `0% <0%> (ø)` | :arrow_up: |
   | [...pache/dolphinscheduler/common/utils/DateUtils.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvY29tbW9uL3V0aWxzL0RhdGVVdGlscy5qYXZh) | `88.04% <0%> (-6.15%)` | :arrow_down: |
   | [...va/org/apache/dolphinscheduler/dao/ProcessDao.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1kYW8vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvZGFvL1Byb2Nlc3NEYW8uamF2YQ==) | `0.86% <0%> (-0.01%)` | :arrow_down: |
   | [...olphinscheduler/api/service/AlertGroupService.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvQWxlcnRHcm91cFNlcnZpY2UuamF2YQ==) | `88.76% <0%> (ø)` | :arrow_up: |
   | [...he/dolphinscheduler/api/service/TenantService.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvVGVuYW50U2VydmljZS5qYXZh) | `72.89% <0%> (ø)` | :arrow_up: |
   | [...cheduler/api/service/ProcessDefinitionService.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvUHJvY2Vzc0RlZmluaXRpb25TZXJ2aWNlLmphdmE=) | `26.82% <0%> (ø)` | :arrow_up: |
   | [...onfiguration/ServiceModelToSwagger2MapperImpl.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2NvbmZpZ3VyYXRpb24vU2VydmljZU1vZGVsVG9Td2FnZ2VyMk1hcHBlckltcGwuamF2YQ==) | `0% <0%> (ø)` | :arrow_up: |
   | [...dolphinscheduler/dao/utils/PostgrePerformance.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1kYW8vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvZGFvL3V0aWxzL1Bvc3RncmVQZXJmb3JtYW5jZS5qYXZh) | `0% <0%> (ø)` | :arrow_up: |
   | [...e/dolphinscheduler/dao/utils/MysqlPerformance.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1kYW8vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvZGFvL3V0aWxzL015c3FsUGVyZm9ybWFuY2UuamF2YQ==) | `0% <0%> (ø)` | :arrow_up: |
   | ... and [5 more](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=footer). Last update [cfe1742...366732d](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] Technoboy- commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716#discussion_r363077895
 
 

 ##########
 File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/FourLetterWordMain.java
 ##########
 @@ -59,23 +59,22 @@ public static String send4LetterWord(String host, int port, String cmd)
      */
     public static String send4LetterWord(String host, int port, String cmd, int timeout)
             throws IOException {
-        LOG.info("connecting to " + host + " " + port);
-        Socket sock = new Socket();
+        LOG.info("connecting to {0} {1}", host, port);
 
 Review comment:
   why {0}, {1} ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] Jave-Chen commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Posted by GitBox <gi...@apache.org>.
Jave-Chen commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716#discussion_r363083044
 
 

 ##########
 File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
 ##########
 @@ -101,7 +101,7 @@ public void handle() throws Exception {
         // set the name of the current thread
         String threadLoggerInfoName = String.format(Constants.TASK_LOG_INFO_FORMAT, taskProps.getTaskAppId());
         Thread.currentThread().setName(threadLoggerInfoName);
-        logger.info(sqlParameters.toString());
+        logger.info("{}", sqlParameters);
 
 Review comment:
   > could we add more prefix message ,like :
   > 
   > ```
   > logger.info("sqlParameters {}", sqlParameters);
   > ```
   
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] codecov-io edited a comment on issue #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716#issuecomment-570896005
 
 
   # [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=h1) Report
   > Merging [#1716](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=desc) into [dev](https://codecov.io/gh/apache/incubator-dolphinscheduler/commit/cfe174293f1a0076340a9ebd84955a6206692257?src=pr&el=desc) will **increase** coverage by `4.22%`.
   > The diff coverage is `0%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/graphs/tree.svg?width=650&token=bv9iXXRLi9&height=150&src=pr)](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##              dev    #1716      +/-   ##
   ==========================================
   + Coverage   17.15%   21.38%   +4.22%     
   ==========================================
     Files         285      293       +8     
     Lines       13900    14047     +147     
     Branches     2267     2319      +52     
   ==========================================
   + Hits         2385     3004     +619     
   + Misses      11240    10716     -524     
   - Partials      275      327      +52
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...lphinscheduler/server/worker/task/sql/SqlTask.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL3dvcmtlci90YXNrL3NxbC9TcWxUYXNrLmphdmE=) | `0% <0%> (ø)` | :arrow_up: |
   | [...dolphinscheduler/api/utils/FourLetterWordMain.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3V0aWxzL0ZvdXJMZXR0ZXJXb3JkTWFpbi5qYXZh) | `0% <0%> (ø)` | :arrow_up: |
   | [...pache/dolphinscheduler/common/utils/DateUtils.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvY29tbW9uL3V0aWxzL0RhdGVVdGlscy5qYXZh) | `88.04% <0%> (-6.15%)` | :arrow_down: |
   | [...he/dolphinscheduler/api/service/TenantService.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvVGVuYW50U2VydmljZS5qYXZh) | `68.42% <0%> (-4.48%)` | :arrow_down: |
   | [...che/dolphinscheduler/api/service/UsersService.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvVXNlcnNTZXJ2aWNlLmphdmE=) | `73.26% <0%> (-0.32%)` | :arrow_down: |
   | [...he/dolphinscheduler/alert/utils/PropertyUtils.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hbGVydC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZG9scGhpbnNjaGVkdWxlci9hbGVydC91dGlscy9Qcm9wZXJ0eVV0aWxzLmphdmE=) | `88.05% <0%> (-0.18%)` | :arrow_down: |
   | [...va/org/apache/dolphinscheduler/dao/ProcessDao.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1kYW8vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvZGFvL1Byb2Nlc3NEYW8uamF2YQ==) | `0.85% <0%> (-0.01%)` | :arrow_down: |
   | [...inscheduler/alert/utils/EnterpriseWeChatUtils.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hbGVydC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZG9scGhpbnNjaGVkdWxlci9hbGVydC91dGlscy9FbnRlcnByaXNlV2VDaGF0VXRpbHMuamF2YQ==) | `0% <0%> (ø)` | :arrow_up: |
   | [...che/dolphinscheduler/alert/runner/AlertSender.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hbGVydC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZG9scGhpbnNjaGVkdWxlci9hbGVydC9ydW5uZXIvQWxlcnRTZW5kZXIuamF2YQ==) | `0% <0%> (ø)` | :arrow_up: |
   | [.../dolphinscheduler/common/zk/ZookeeperOperator.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvY29tbW9uL3prL1pvb2tlZXBlck9wZXJhdG9yLmphdmE=) | `0% <0%> (ø)` | :arrow_up: |
   | ... and [86 more](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=footer). Last update [cfe1742...f10bef0](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] sonarcloud[bot] commented on issue #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on issue #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716#issuecomment-574165399
 
 
   SonarCloud Quality Gate failed.
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=1716&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=1716&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=1716&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=1716&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=1716&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=1716&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=1716&resolved=false&types=SECURITY_HOTSPOT) [1 Security Hotspot](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=1716&resolved=false&types=SECURITY_HOTSPOT) to review)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=1716&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=1716&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=1716&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=1716&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=1716&metric=new_coverage&view=list)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=1716&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=1716&metric=new_duplicated_lines_density&view=list)
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] dailidong commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Posted by GitBox <gi...@apache.org>.
dailidong commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716#discussion_r363068716
 
 

 ##########
 File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/FourLetterWordMain.java
 ##########
 @@ -59,23 +59,22 @@ public static String send4LetterWord(String host, int port, String cmd)
      */
     public static String send4LetterWord(String host, int port, String cmd, int timeout)
             throws IOException {
-        LOG.info("connecting to " + host + " " + port);
-        Socket sock = new Socket();
+        LOG.info("connecting to {0} {1}", host, port);
 
 Review comment:
   +1

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] Jave-Chen commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Posted by GitBox <gi...@apache.org>.
Jave-Chen commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716#discussion_r363080997
 
 

 ##########
 File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
 ##########
 @@ -101,7 +101,7 @@ public void handle() throws Exception {
         // set the name of the current thread
         String threadLoggerInfoName = String.format(Constants.TASK_LOG_INFO_FORMAT, taskProps.getTaskAppId());
         Thread.currentThread().setName(threadLoggerInfoName);
-        logger.info(sqlParameters.toString());
+        logger.info("{}", sqlParameters);
 
 Review comment:
   SqlParameters override toString method.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] dailidong commented on issue #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Posted by GitBox <gi...@apache.org>.
dailidong commented on issue #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716#issuecomment-574170024
 
 
   +1

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] Jave-Chen commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Posted by GitBox <gi...@apache.org>.
Jave-Chen commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716#discussion_r363081285
 
 

 ##########
 File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
 ##########
 @@ -101,7 +101,7 @@ public void handle() throws Exception {
         // set the name of the current thread
         String threadLoggerInfoName = String.format(Constants.TASK_LOG_INFO_FORMAT, taskProps.getTaskAppId());
         Thread.currentThread().setName(threadLoggerInfoName);
-        logger.info(sqlParameters.toString());
+        logger.info("{}", sqlParameters);
 
 Review comment:
   SqlParameters override toString method.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] codecov-io edited a comment on issue #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716#issuecomment-570896005
 
 
   # [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=h1) Report
   > Merging [#1716](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=desc) into [dev](https://codecov.io/gh/apache/incubator-dolphinscheduler/commit/87e8f0d83bf137f2e469422a4fb042efc407b319?src=pr&el=desc) will **not change** coverage.
   > The diff coverage is `0%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/graphs/tree.svg?width=650&token=bv9iXXRLi9&height=150&src=pr)](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##              dev    #1716   +/-   ##
   =======================================
     Coverage   17.48%   17.48%           
   =======================================
     Files         285      285           
     Lines       13912    13912           
     Branches     2274     2275    +1     
   =======================================
     Hits         2433     2433           
     Misses      11206    11206           
     Partials      273      273
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...lphinscheduler/server/worker/task/sql/SqlTask.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL3dvcmtlci90YXNrL3NxbC9TcWxUYXNrLmphdmE=) | `0% <0%> (ø)` | :arrow_up: |
   | [...dolphinscheduler/api/utils/FourLetterWordMain.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3V0aWxzL0ZvdXJMZXR0ZXJXb3JkTWFpbi5qYXZh) | `0% <0%> (ø)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=footer). Last update [87e8f0d...e5b816e](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1716?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] Jave-Chen commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Posted by GitBox <gi...@apache.org>.
Jave-Chen commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716#discussion_r363081905
 
 

 ##########
 File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/FourLetterWordMain.java
 ##########
 @@ -59,23 +59,22 @@ public static String send4LetterWord(String host, int port, String cmd)
      */
     public static String send4LetterWord(String host, int port, String cmd, int timeout)
             throws IOException {
-        LOG.info("connecting to " + host + " " + port);
-        Socket sock = new Socket();
+        LOG.info("connecting to {0} {1}", host, port);
 
 Review comment:
   fixed

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] Technoboy- merged pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Posted by GitBox <gi...@apache.org>.
Technoboy- merged pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] Technoboy- commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716#discussion_r363077852
 
 

 ##########
 File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
 ##########
 @@ -101,7 +101,7 @@ public void handle() throws Exception {
         // set the name of the current thread
         String threadLoggerInfoName = String.format(Constants.TASK_LOG_INFO_FORMAT, taskProps.getTaskAppId());
         Thread.currentThread().setName(threadLoggerInfoName);
-        logger.info(sqlParameters.toString());
+        logger.info("{}", sqlParameters);
 
 Review comment:
   could we add more prefix message ,like :
   ```
   logger.info("sqlParameters {}", sqlParameters);
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] Jave-Chen commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Posted by GitBox <gi...@apache.org>.
Jave-Chen commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716#discussion_r363080997
 
 

 ##########
 File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
 ##########
 @@ -101,7 +101,7 @@ public void handle() throws Exception {
         // set the name of the current thread
         String threadLoggerInfoName = String.format(Constants.TASK_LOG_INFO_FORMAT, taskProps.getTaskAppId());
         Thread.currentThread().setName(threadLoggerInfoName);
-        logger.info(sqlParameters.toString());
+        logger.info("{}", sqlParameters);
 
 Review comment:
   SqlParameters override toString method.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] dailidong commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Posted by GitBox <gi...@apache.org>.
dailidong commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716#discussion_r363067539
 
 

 ##########
 File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
 ##########
 @@ -101,7 +101,7 @@ public void handle() throws Exception {
         // set the name of the current thread
         String threadLoggerInfoName = String.format(Constants.TASK_LOG_INFO_FORMAT, taskProps.getTaskAppId());
         Thread.currentThread().setName(threadLoggerInfoName);
-        logger.info(sqlParameters.toString());
+        logger.info("{}", sqlParameters);
 
 Review comment:
   +1

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] dailidong commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Posted by GitBox <gi...@apache.org>.
dailidong commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716#discussion_r363068718
 
 

 ##########
 File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/FourLetterWordMain.java
 ##########
 @@ -59,23 +59,22 @@ public static String send4LetterWord(String host, int port, String cmd)
      */
     public static String send4LetterWord(String host, int port, String cmd, int timeout)
             throws IOException {
-        LOG.info("connecting to " + host + " " + port);
-        Socket sock = new Socket();
+        LOG.info("connecting to {0} {1}", host, port);
         InetSocketAddress hostaddress= host != null ? new InetSocketAddress(host, port) :
                 new InetSocketAddress(InetAddress.getByName(null), port);
-        BufferedReader reader = null;
-        try {
+        
+        try (Socket sock = new Socket();
+             OutputStream outstream = sock.getOutputStream();
+             BufferedReader reader =
+                    new BufferedReader(
+                            new InputStreamReader(sock.getInputStream()))) {
             sock.setSoTimeout(timeout);
             sock.connect(hostaddress, timeout);
-            OutputStream outstream = sock.getOutputStream();
             outstream.write(cmd.getBytes());
             outstream.flush();
             // this replicates NC - close the output stream before reading
 
 Review comment:
   +1

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] dailidong commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause.

Posted by GitBox <gi...@apache.org>.
dailidong commented on a change in pull request #1716: Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. 
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1716#discussion_r363068712
 
 

 ##########
 File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
 ##########
 @@ -446,6 +452,6 @@ public void printReplacedSql(String content, String formatSql,String rgex, Map<I
         for(int i=1;i<=sqlParamsMap.size();i++){
             logPrint.append(sqlParamsMap.get(i).getValue()+"("+sqlParamsMap.get(i).getType()+")");
         }
-        logger.info(logPrint.toString());
+        logger.info("{}", logPrint);
 
 Review comment:
   +1

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services