ppkarwasz commented on code in PR #790:
URL: https://github.com/apache/commons-io/pull/790#discussion_r2393648020
##########
src/main/java/org/apache/commons/io/input/ClosedReader.java:
##########
@@ -71,6 +71,10 @@ public void close() throws IOException {
*/
@Override
public int read(final char[] cbuf, final int off, final int len) {
+ IOUtils.checkFromIndexSize(cbuf, off, len);
Review Comment:
The method's Javadoc needs certainly to be updated. The class Javadoc itself
says:
> Typically uses of this class include testing for corner cases in methods
that accept readers and acting as a sentinel value instead of a `null` reader.
If it is used as a sentinel in production code (like, e.g. in
`CloseShieldReader`), callers should still be able to rely on the standard
`Reader` semantics.
For test scenarios, if callers don't want to pass a char array as argument,
they can use Mockito instead.
I fixed the Javadoc and tests in
https://github.com/apache/commons-io/pull/790/commits/68c1ba463d3d0d48ddf2e0ea0a06c5153d5052e1.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]