ppkarwasz commented on code in PR #790:
URL: https://github.com/apache/commons-io/pull/790#discussion_r2395894706
##########
src/main/java/org/apache/commons/io/input/SequenceReader.java:
##########
@@ -114,9 +115,9 @@ public int read() throws IOException {
*/
@Override
public int read(final char[] cbuf, int off, int len) throws IOException {
- Objects.requireNonNull(cbuf, "cbuf");
- if (len < 0 || off < 0 || off + len > cbuf.length) {
- throw new IndexOutOfBoundsException("Array Size=" + cbuf.length +
", offset=" + off + ", length=" + len);
+ IOUtils.checkFromIndexSize(cbuf, off, len);
Review Comment:
I removed the Javadoc in
https://github.com/apache/commons-io/pull/790/commits/8d520f72c3698440e2275b860a991a41757ad2fb
##########
src/main/java/org/apache/commons/io/output/AppendableWriter.java:
##########
@@ -124,10 +126,7 @@ public T getAppendable() {
*/
@Override
public void write(final char[] cbuf, final int off, final int len) throws
IOException {
- Objects.requireNonNull(cbuf, "cbuf");
- if (len < 0 || off + len > cbuf.length) {
- throw new IndexOutOfBoundsException("Array Size=" + cbuf.length +
", offset=" + off + ", length=" + len);
- }
+ IOUtils.checkFromIndexSize(cbuf, off, len);
Review Comment:
Fixed in
https://github.com/apache/commons-io/pull/790/commits/8d520f72c3698440e2275b860a991a41757ad2fb
--
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]