Apache Solr open-source search software
LUCENE-6932: also fix NIOFSIndexInput to throw EOFE if you seek beyond end of file
Michael McCandless95b424b6e17d
diff --git a/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java b/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.javaindex 84f1a7ff899..b7392904fd1 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);+ }+ }}}