Jave-Chen opened a new issue #1688: [BUG] Fix bug : Use try-with-resources or 
close this "ResultSet" in a "finally" clause
URL: https://github.com/apache/incubator-dolphinscheduler/issues/1688
 
 
   *For better global communication, please give priority to using English 
description, thx! *
   
   **Describe the bug**
   A clear and concise description of what the bug is.
   Connections, streams, files, and other classes that implement the Closeable 
interface or its super-interface, AutoCloseable, needs to be closed after use. 
Further, that close call must be made in a finally block otherwise an exception 
could keep the call from being made. Preferably, when class implements 
AutoCloseable, resource should be created using "try-with-resources" pattern 
and will be closed automatically.
   
   Failure to properly close resources will result in a resource leak which 
could bring first the application and then perhaps the box it's on to their 
knees.
   
   **Source FIle**
   
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/PostgrePerformance.java
   
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/MysqlPerformance.java
   
   **SonarCloud Link**
   
https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&issues=AW9PvjdUYzPBRjkobYmb&open=AW9PvjdUYzPBRjkobYmb
   
https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&issues=AW9PvjdUYzPBRjkobYma&open=AW9PvjdUYzPBRjkobYma
   
https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&issues=AW9PvjdUYzPBRjkobYmc&open=AW9PvjdUYzPBRjkobYmc
   
   
https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&issues=AW9Pvjd_YzPBRjkobYmy&open=AW9Pvjd_YzPBRjkobYmy
   
https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&issues=AW9Pvjd_YzPBRjkobYmx&open=AW9Pvjd_YzPBRjkobYmx
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to