当前位置:网站首页>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
边栏推荐
- Flex布局—固定定位+流式布局—主轴对齐—侧轴对齐—伸缩比
- Unittest unit test framework full stack knowledge
- regular expression
- Starfish Os打造的元宇宙生态,跟MetaBell的合作只是开始
- "Risking your life to upload" proe/creo product structure design - seam and buckle
- Codeworks round 810 (Div. 2) a~c problem solution
- 重要安排-DX12引擎开发课程后续直播将在B站进行
- Software test interview questions: common post data submission methods
- MySQL 中的 INSERT 是怎么加锁的?(荣耀典藏版)
- How MySQL uses indexes (glory Collection Edition)
猜你喜欢

Promise from getting started to mastering (Chapter 3: customize (handwriting) promise)

Leetcode hot topic Hot 100 - > 1. Sum of two numbers

Codeworks round 807 (Div. 2) a-c problem solution

11 Django basics database operation

LeetCode 热题 HOT 100 -> 3. 无重复字符的最长子串

Codeworks round 810 (Div. 2) a~c problem solution

Ceresdao: the world's first decentralized digital asset management protocol based on Dao enabled Web3.0

MySQL高可用和主从同步

Clear the cause of floating and six methods (solve the problem that floating affects the parent element and the global)

Smart contract security -- selfdestroy attack
随机推荐
regular expression
产品解读丨MeterSphere UI测试模块的设计与分布式扩展
MySQL create stored procedure ------ [hy000][1418] this function has none of deterministic, no SQL
小米网站主页面大模块——小模块+导航(浮动案例)
Promise from getting started to mastering (Chapter 3: customize (handwriting) promise)
MySQL's way to solve deadlock - lock analysis of common SQL statements
Eredi reappeared at the digital China Summit and continued to deepen the protection of green waters and mountains with science and technology
视频常用分辨率
Under the new retail format, retail e-commerce RPA helps reshape growth
小程序毕设作品之微信校园浴室预约小程序毕业设计成品(1)开发概要
[advanced ROS] Lecture 9 robot model motion based on rviz and arbotix control
这个操作可能不值钱,但却值得学习 | 【图片批量裁剪】
【ROS进阶篇】第十讲 基于Gazebo的URDF集成仿真流程及实例
Wechat campus bathroom reservation applet graduation design finished product (1) development outline
[Star Project] small hat aircraft War (VI)
埃睿迪再度亮相数字中国峰会 持续深化用科技守护绿水青山
Codeworks round 810 (Div. 2) a~c problem solution
Understand the "next big trend" in the encryption industry - ventures Dao
探究flex-basis
[Yugong series] use of tabby integrated terminal in July 2022