bmesser     2004/11/28 05:33:55

  Modified:    src/java/org/apache/lucene/store BufferedIndexInput.java
  Log:
  avoid ArrayIndexOutOfBoundsException in method refill() when bufferLength 
gets a negativ value. It happens when TermVectorsReader.get(int docID) is used 
with a docID larger than number of documents stored in the index.
  
  Revision  Changes    Path
  1.3       +1 -1      
jakarta-lucene/src/java/org/apache/lucene/store/BufferedIndexInput.java
  
  Index: BufferedIndexInput.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-lucene/src/java/org/apache/lucene/store/BufferedIndexInput.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BufferedIndexInput.java   28 Sep 2004 18:15:52 -0000      1.2
  +++ BufferedIndexInput.java   28 Nov 2004 13:33:55 -0000      1.3
  @@ -56,7 +56,7 @@
       if (end > length())                                // don't read past EOF
         end = length();
       bufferLength = (int)(end - start);
  -    if (bufferLength == 0)
  +    if (bufferLength <= 0)
         throw new IOException("read past EOF");
   
       if (buffer == null)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to