lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1697364 - /lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/ChecksumIndexInput.java
Date Mon, 24 Aug 2015 12:27:47 GMT
Author: mikemccand
Date: Mon Aug 24 12:27:47 2015
New Revision: 1697364

URL: http://svn.apache.org/r1697364
Log:
add more detail to exception message

Modified:
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/ChecksumIndexInput.java

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/ChecksumIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/ChecksumIndexInput.java?rev=1697364&r1=1697363&r2=1697364&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/ChecksumIndexInput.java
(original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/ChecksumIndexInput.java
Mon Aug 24 12:27:47 2015
@@ -44,9 +44,10 @@ public abstract class ChecksumIndexInput
    */
   @Override
   public void seek(long pos) throws IOException {
-    final long skip = pos - getFilePointer();
+    final long curFP = getFilePointer();
+    final long skip = pos - curFP;
     if (skip < 0) {
-      throw new IllegalStateException(getClass() + " cannot seek backwards");
+      throw new IllegalStateException(getClass() + " cannot seek backwards (pos=" + pos +
" getFilePointer()=" + curFP + ")");
     }
     skipBytes(skip);
   }



Mime
View raw message