BuckPrologCompiler: Use auto-closeable FileInputStream

Change-Id: I77bb3d6ca7de77c01fb512bc25b78b069be28199
This commit is contained in:
David Pursehouse 2015-03-20 14:48:11 +09:00
parent 1e2458a0ef
commit a7a2cc2842

View File

@ -75,8 +75,7 @@ public class BuckPrologCompiler {
}
JarEntry e = new JarEntry(prefix + name);
FileInputStream in = new FileInputStream(f);
try {
try (FileInputStream in = new FileInputStream(f)) {
e.setTime(f.lastModified());
out.putNextEntry(e);
byte[] buf = new byte[16 << 10];
@ -85,7 +84,6 @@ public class BuckPrologCompiler {
out.write(buf, 0, n);
}
} finally {
in.close();
out.closeEntry();
}
}