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 2015/08/24 14:58:59 UTC

svn commit: r1697377 - in /lucene/dev/branches/branch_5x: ./ lucene/ lucene/core/ lucene/core/src/java/org/apache/lucene/store/ChecksumIndexInput.java

Author: mikemccand
Date: Mon Aug 24 12:58:58 2015
New Revision: 1697377

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

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/lucene/   (props changed)
    lucene/dev/branches/branch_5x/lucene/core/   (props changed)
    lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/store/ChecksumIndexInput.java

Modified: lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/store/ChecksumIndexInput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/store/ChecksumIndexInput.java?rev=1697377&r1=1697376&r2=1697377&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/store/ChecksumIndexInput.java (original)
+++ lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/store/ChecksumIndexInput.java Mon Aug 24 12:58:58 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);
   }