jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1411604 - /jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/ReadOnlyOakDirectory.java
Date Tue, 20 Nov 2012 09:55:51 GMT
Author: alexparvulescu
Date: Tue Nov 20 09:55:50 2012
New Revision: 1411604

URL: http://svn.apache.org/viewvc?rev=1411604&view=rev
Log:
OAK-154 Full text search index
 - ran into the idea that a seek to the very end of the file might happen, so I added a guard

Modified:
    jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/ReadOnlyOakDirectory.java

Modified: jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/ReadOnlyOakDirectory.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/ReadOnlyOakDirectory.java?rev=1411604&r1=1411603&r2=1411604&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/ReadOnlyOakDirectory.java
(original)
+++ jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/ReadOnlyOakDirectory.java
Tue Nov 20 09:55:50 2012
@@ -165,7 +165,9 @@ class ReadOnlyOakDirectory extends Direc
 
         @Override
         public void seek(long pos) throws IOException {
-            if (pos < 0 || pos >= data.length) {
+            //seek() may be called with pos == data.length
+            //see https://issues.apache.org/jira/browse/LUCENE-1196
+            if (pos < 0 || pos > data.length) {
                 throw new IOException("Invalid seek request");
             } else {
                 position = (int) pos;



Mime
View raw message