Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
leaf-hlcm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hlcm
leaf-hlcm
Commits
115862fe
Commit
115862fe
authored
Jul 19, 2023
by
王炜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整产品excel导入并保存文件可能出现流未正常关闭,内存泄露问题
parent
641c6a94
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
37 deletions
+46
-37
ImportExcel.java
src/main/java/leaf/plugin/dataimport/ImportExcel.java
+46
-37
No files found.
src/main/java/leaf/plugin/dataimport/ImportExcel.java
View file @
115862fe
...
...
@@ -147,10 +147,11 @@ public class ImportExcel extends AbstractEntry {
throw
new
IllegalArgumentException
();
}
FileOutputStream
fout
=
new
FileOutputStream
(
savePath
);
try
{
byte
[]
buffer
=
new
byte
[
1024
];
int
len
=
0
;
int
size
=
0
;
while
((
len
=
in
.
read
(
buffer
))
>
0
)
{
while
((
len
=
in
.
read
(
buffer
))
>
0
)
{
fout
.
write
(
buffer
,
0
,
len
);
size
+=
len
;
}
...
...
@@ -185,6 +186,14 @@ public class ImportExcel extends AbstractEntry {
cstm
.
setLong
(
4
,
Long
.
valueOf
(
user_id
));
// user_id
cstm
.
execute
();
cstm
.
close
();
}
finally
{
if
(
fout
!=
null
){
fout
.
close
();
}
if
(
in
!=
null
){
in
.
close
();
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment