IDEMPIERE-5368 Pack In doesn't close resources properly on failure (#1424)

Change code to use try-with-resources to ensure automatic cleanup.
This commit is contained in:
Fr Jeremy Krieg 2022-08-05 11:19:10 +09:30 committed by GitHub
parent 464de082a5
commit d78238b0f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -131,8 +131,7 @@ public class PackIn {
if (log.isLoggable(Level.INFO)) log.info("importXML:" + msg);
return msg;
}
try {
FileInputStream input = new FileInputStream(in);
try (FileInputStream input = new FileInputStream(in)) {
return importXML(input, ctx, trxName);
} catch (Exception e) {
log.log(Level.SEVERE, "importXML:", e);