lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bmes...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/store BufferedIndexInput.java
Date Sun, 28 Nov 2004 13:33:55 GMT
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: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message