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/01/22 16:19:10 UTC

svn commit: r1726229 - /lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java

Author: mikemccand
Date: Fri Jan 22 15:19:10 2016
New Revision: 1726229

URL: http://svn.apache.org/viewvc?rev=1726229&view=rev
Log:
LUCENE-6932: also fix NIOFSIndexInput to throw EOFE if you seek beyond end of file

Modified:
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java?rev=1726229&r1=1726228&r2=1726229&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java Fri Jan 22 15:19:10 2016
@@ -192,6 +192,10 @@ public class NIOFSDirectory extends FSDi
     }
 
     @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);
+      }
+    }
   }
 }