LUCENE-3539: include resource in a few more cases

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1200051 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2011-11-09 23:57:24 +00:00
parent 8162656384
commit c0c36d00d6
3 changed files with 4 additions and 3 deletions

View File

@ -97,7 +97,7 @@ public class WindowsDirectory extends FSDirectory {
}
if (bytesRead != length) {
throw new EOFException("Read past EOF: " + this);
throw new EOFException("Read past EOF (resource: " + this + ")");
}
}

View File

@ -18,6 +18,7 @@ package org.apache.lucene.store;
*/
import java.io.File;
import java.io.EOFException;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.ClosedChannelException; // javadoc @link
@ -181,7 +182,7 @@ public class NIOFSDirectory extends FSDirectory {
long pos = getFilePointer() + off;
if (pos + len > end) {
throw new IOException("read past EOF: " + this);
throw new EOFException("read past EOF (resource: " + this + ")");
}
try {

View File

@ -91,7 +91,7 @@ public class RAMInputStream extends IndexInput implements Cloneable {
if (currentBufferIndex >= file.numBuffers()) {
// end of file reached, no more buffers left
if (enforceEOF) {
throw new EOFException("Read past EOF: " + this);
throw new EOFException("Read past EOF (resource: " + this + ")");
} else {
// Force EOF if a read takes place at this position
currentBufferIndex--;