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:33 UTC
[5/9] lucene-solr git commit: LUCENE-6932: also fix RAFIndexInput to
throw EOFE if you seek beyond end of file
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 <mi...@apache.org>
Authored: Fri Jan 22 19:00:47 2016 +0000
Committer: Mike McCandless <mi...@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 {