You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2016/02/10 17:27:31 UTC
[3/9] lucene-solr git commit: LUCENE-6932: also fix NIOFSIndexInput
to throw EOFE if you seek beyond end of file
LUCENE-6932: also fix NIOFSIndexInput to throw EOFE if you seek beyond end of file
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/branch_5x@1726231 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b4fa82b0
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b4fa82b0
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b4fa82b0
Branch: refs/heads/branch_5_4
Commit: b4fa82b0772718d84db3d177f8ce7450be3c51ac
Parents: 9041c1c
Author: Michael McCandless <mi...@apache.org>
Authored: Fri Jan 22 15:21:20 2016 +0000
Committer: Mike McCandless <mi...@apache.org>
Committed: Wed Feb 10 10:46:52 2016 -0500
----------------------------------------------------------------------
.../core/src/java/org/apache/lucene/store/NIOFSDirectory.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b4fa82b0/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java b/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java
index 84f1a7f..b739290 100644
--- a/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java
@@ -192,6 +192,10 @@ public class NIOFSDirectory extends FSDirectory {
}
@Override
- protected void seekInternal(long pos) throws IOException {}
+ protected void seekInternal(long pos) throws IOException {
+ if (pos > length()) {
+ throw new EOFException("read past EOF: pos=" + pos + " vs length=" + length() + ": " + this);
+ }
+ }
}
}