Mercurial > hg4j
diff src/org/tmatesoft/hg/internal/FilterDataAccess.java @ 188:facfd8518367
[4] IllegalArgumentException: Underflow. Legitimate attempt to read 0 bytes lead to exception
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 14 Apr 2011 02:46:35 +0200 |
parents | b413b16d10a5 |
children | 5e95b0da26f2 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/FilterDataAccess.java Thu Apr 14 01:11:40 2011 +0200 +++ b/src/org/tmatesoft/hg/internal/FilterDataAccess.java Thu Apr 14 02:46:35 2011 +0200 @@ -99,8 +99,11 @@ @Override public void readBytes(byte[] b, int off, int len) throws IOException { + if (len == 0) { + return; + } if (count <= 0 || len > count) { - throw new IllegalArgumentException("Underflow"); // XXX be descriptive + throw new IllegalArgumentException(String.format("Underflow. Bytes left: %d, asked to read %d", count, len)); } if (count == length) { dataAccess.seek(offset);