lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject [5/9] lucene-solr git commit: LUCENE-6932: also fix RAFIndexInput to throw EOFE if you seek beyond end of file
Date Wed, 10 Feb 2016 16:27:33 GMT
LUCENE-6932: also fix RAFIndexInput to throw EOFE if you seek beyond end of file

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/branch_5x@1726290 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/2512ab6c
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/2512ab6c
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/2512ab6c

Branch: refs/heads/branch_5_4
Commit: 2512ab6c1f3089cb8fe534532f0676c3358a5cd4
Parents: 041cd94
Author: Michael McCandless <mikemccand@apache.org>
Authored: Fri Jan 22 19:00:47 2016 +0000
Committer: Mike McCandless <mikemccand@apache.org>
Committed: Wed Feb 10 10:47:11 2016 -0500

----------------------------------------------------------------------
 lucene/misc/src/java/org/apache/lucene/store/RAFDirectory.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/2512ab6c/lucene/misc/src/java/org/apache/lucene/store/RAFDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/misc/src/java/org/apache/lucene/store/RAFDirectory.java b/lucene/misc/src/java/org/apache/lucene/store/RAFDirectory.java
index 9c3e9b0..94be104 100644
--- a/lucene/misc/src/java/org/apache/lucene/store/RAFDirectory.java
+++ b/lucene/misc/src/java/org/apache/lucene/store/RAFDirectory.java
@@ -165,7 +165,10 @@ public class RAFDirectory extends FSDirectory {
     }
   
     @Override
-    protected void seekInternal(long position) {
+    protected void seekInternal(long pos) throws IOException {
+      if (pos > length()) {
+        throw new EOFException("read past EOF: pos=" + pos + " vs length=" + length() + ":
" + this);
+      }
     }
     
     boolean isFDValid() throws IOException {


Mime
View raw message