You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@orc.apache.org by prasanthj <gi...@git.apache.org> on 2018/02/15 01:23:20 UTC
[GitHub] orc pull request #218: ORC-301. `extractFileTail` should open a file in `try...
Github user prasanthj commented on a diff in the pull request:
https://github.com/apache/orc/pull/218#discussion_r168361642
--- Diff: java/core/src/java/org/apache/orc/impl/ReaderImpl.java ---
@@ -516,12 +516,13 @@ OrcTail buildEmptyTail() {
protected OrcTail extractFileTail(FileSystem fs, Path path,
long maxFileLength) throws IOException {
- FSDataInputStream file = fs.open(path);
+ FSDataInputStream file = null;
ByteBuffer buffer;
OrcProto.PostScript ps;
OrcProto.FileTail.Builder fileTailBuilder = OrcProto.FileTail.newBuilder();
long modificationTime;
try {
--- End diff --
Maybe replace with try-with-resource block?
---