Skip to content

Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. #1716

Merged
Technoboy- merged 4 commits intoapache:devfrom
Jave-Chen:bcai-dev-fix-1714
Jan 17, 2020
Merged

Fix bug: Use try-with-resources or close this "Socket" in a "finally" clause. #1716
Technoboy- merged 4 commits intoapache:devfrom
Jave-Chen:bcai-dev-fix-1714

Conversation

@Jave-Chen
Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor

@davidzollo davidzollo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1

suggestion: please add unit test, you will find the question

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jan 5, 2020

Codecov Report

Merging #1716 into dev will increase coverage by 4.22%.
The diff coverage is 0%.

Impacted file tree graph

@@            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 Coverage Δ
...lphinscheduler/server/worker/task/sql/SqlTask.java 0% <0%> (ø) ⬆️
...dolphinscheduler/api/utils/FourLetterWordMain.java 0% <0%> (ø) ⬆️
...pache/dolphinscheduler/common/utils/DateUtils.java 88.04% <0%> (-6.15%) ⬇️
...he/dolphinscheduler/api/service/TenantService.java 68.42% <0%> (-4.48%) ⬇️
...che/dolphinscheduler/api/service/UsersService.java 73.26% <0%> (-0.32%) ⬇️
...he/dolphinscheduler/alert/utils/PropertyUtils.java 88.05% <0%> (-0.18%) ⬇️
...va/org/apache/dolphinscheduler/dao/ProcessDao.java 0.85% <0%> (-0.01%) ⬇️
...inscheduler/alert/utils/EnterpriseWeChatUtils.java 0% <0%> (ø) ⬆️
...che/dolphinscheduler/alert/runner/AlertSender.java 0% <0%> (ø) ⬆️
.../dolphinscheduler/common/zk/ZookeeperOperator.java 0% <0%> (ø) ⬆️
... and 86 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cfe1742...f10bef0. Read the comment docs.

@sonarqubecloud
Copy link
Copy Markdown

SonarCloud Quality Gate failed.

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 1 Security Hotspot to review)
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Copy Markdown
Contributor

@davidzollo davidzollo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@davidzollo
Copy link
Copy Markdown
Contributor

+1

Copy link
Copy Markdown
Contributor

@Technoboy- Technoboy- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants