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 2016/04/14 11:51:17 UTC

lucene-solr:branch_6_0: improve exception messages when requested slice is out of bounds

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6_0 9a2645d4d -> dec4067de


improve exception messages when requested slice is out of bounds


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/dec4067d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/dec4067d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/dec4067d

Branch: refs/heads/branch_6_0
Commit: dec4067de0467ce31df63720e594b30205b5019f
Parents: 9a2645d
Author: Mike McCandless <mi...@apache.org>
Authored: Thu Apr 14 05:52:53 2016 -0400
Committer: Mike McCandless <mi...@apache.org>
Committed: Thu Apr 14 05:53:45 2016 -0400

----------------------------------------------------------------------
 lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java   | 2 +-
 .../core/src/java/org/apache/lucene/store/SimpleFSDirectory.java   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dec4067d/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java b/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java
index 751e14e..27a90e8 100644
--- a/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/NIOFSDirectory.java
@@ -134,7 +134,7 @@ public class NIOFSDirectory extends FSDirectory {
     @Override
     public IndexInput slice(String sliceDescription, long offset, long length) throws IOException {
       if (offset < 0 || length < 0 || offset + length > this.length()) {
-        throw new IllegalArgumentException("slice() " + sliceDescription + " out of bounds: "  + this);
+        throw new IllegalArgumentException("slice() " + sliceDescription + " out of bounds: offset=" + offset + ",length=" + length + ",fileLength="  + this.length() + ": "  + this);
       }
       return new NIOFSIndexInput(getFullSliceDescription(sliceDescription), channel, off + offset, length, getBufferSize());
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/dec4067d/lucene/core/src/java/org/apache/lucene/store/SimpleFSDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/SimpleFSDirectory.java b/lucene/core/src/java/org/apache/lucene/store/SimpleFSDirectory.java
index 87fde83..0d650ae 100644
--- a/lucene/core/src/java/org/apache/lucene/store/SimpleFSDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/SimpleFSDirectory.java
@@ -130,7 +130,7 @@ public class SimpleFSDirectory extends FSDirectory {
     @Override
     public IndexInput slice(String sliceDescription, long offset, long length) throws IOException {
       if (offset < 0 || length < 0 || offset + length > this.length()) {
-        throw new IllegalArgumentException("slice() " + sliceDescription + " out of bounds: "  + this);
+        throw new IllegalArgumentException("slice() " + sliceDescription + " out of bounds: offset=" + offset + ",length=" + length + ",fileLength="  + this.length() + ": "  + this);
       }
       return new SimpleFSIndexInput(getFullSliceDescription(sliceDescription), channel, off + offset, length, getBufferSize());
     }