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:
parent
464de082a5
commit
d78238b0f6
|
@ -131,8 +131,7 @@ public class PackIn {
|
||||||
if (log.isLoggable(Level.INFO)) log.info("importXML:" + msg);
|
if (log.isLoggable(Level.INFO)) log.info("importXML:" + msg);
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
try {
|
try (FileInputStream input = new FileInputStream(in)) {
|
||||||
FileInputStream input = new FileInputStream(in);
|
|
||||||
return importXML(input, ctx, trxName);
|
return importXML(input, ctx, trxName);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.log(Level.SEVERE, "importXML:", e);
|
log.log(Level.SEVERE, "importXML:", e);
|
||||||
|
|
Loading…
Reference in New Issue