-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optimize: auto closeable #1884
optimize: auto closeable #1884
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1884 +/- ##
=============================================
+ Coverage 55.16% 55.34% +0.18%
- Complexity 2377 2382 +5
=============================================
Files 422 423 +1
Lines 14395 14270 -125
Branches 1730 1693 -37
=============================================
- Hits 7941 7898 -43
+ Misses 5709 5662 -47
+ Partials 745 710 -35
|
core/src/main/java/io/seata/core/store/db/LockStoreDataBaseDAO.java
Outdated
Show resolved
Hide resolved
why not use try-with-resources? |
I found all resource in this change could use try-with-resource, and that can be closed automatic. Maybe change to use try-with-resource is better. |
@echooymxq @helloworlde Not all places can be used try-with-resources. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@jsbxyyx database operation related variable names can be optimized. |
@slievrly OK. |
It's can be closed by multiple try. |
If use try-with-resources, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Ⅰ. Describe what this PR did
optimize: auto closeable
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews