当前位置:网站首页>Use try-with-resources or close this
Use try-with-resources or close this
2022-07-28 02:27:00 【51CTO】
Use try-with-resources or close this "FileOutputStream" in a "finally" clause.

Original code :
Use sonar Scanned out bug Need repair . The result after modification is :
After scanning

Prompt no problem , The result is perfect !
The modification opinions given by the audit tool are :
try(){
}catch (Exception e) {
}
Written in try() It will automatically close the flow, and there is no need to continue other operations , as for try What is defined inside needs to be redefined finally Shut down
边栏推荐
- 实际工作中,我是如何使用 Postman 做接口测试?
- 支付宝小程序授权/获取用户信息
- Smart contract security -- selfdestroy attack
- MySQL create stored procedure ------ [hy000][1418] this function has none of deterministic, no SQL
- Unittest单元测试框架全栈知识
- SFTP file / folder upload server
- Leetcode hot topic Hot 100 - > 2. Add two numbers
- Software test interview questions: common post data submission methods
- ArcGIS: loading historical remote sensing images
- mysql创建存储过程---------[HY000][1418] This function has none of DETERMINISTIC, NO SQL
猜你喜欢
随机推荐
「冒死上传」Proe/Creo产品结构设计-止口与扣位
LeetCode 热题 HOT 100 -> 3. 无重复字符的最长子串
正则表达式
Two ways for wechat applet to realize dynamic horizontal step bar
【Star项目】小帽飞机大战(六)
一文读懂Plato Farm的ePLATO,以及其高溢价缘由
pytorch优化器设置
Day6 函数和模块的使用
Shell regular and metacharacters
这个操作可能不值钱,但却值得学习 | 【图片批量裁剪】
数字赋能 创新未来:海丝埃睿迪亮相第五届数字中国建设峰会
Leetcode hot topic Hot 100 - > 2. Add two numbers
Promise from introduction to mastery (Chapter 2 understanding and use of promise)
Go learning 01
上课笔记(5)(1)——#593. 二分查找(binary)
OBS keyboard plug-in custom DIY
【HCIP】BGP 特性
Under the new retail format, retail e-commerce RPA helps reshape growth
54: Chapter 5: develop admin management services: 7: face warehousing process; Face login process; The browser turns on the video debugging mode (so that the camera can also be turned on in the case o
新零售业态下,零售电商RPA助力重塑增长








