You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@commons.apache.org by GitBox <gi...@apache.org> on 2025/10/03 18:08:20 UTC

[GH] (commons-io/fix/io-utils-read): Workflow run "Java CI" failed!

The GitHub Actions job "Java CI" on commons-io.git/fix/io-utils-read has failed.
Run started by GitHub user ppkarwasz (triggered by ppkarwasz).

Head commit for run:
1d681bc32323d59150b2355c7dd2dd5ffa1c75a5 / Piotr P. Karwasz <pk...@apache.org>
Add missing `read` argument validation in `IOUtils`

In #790 I introduced `IOUtils#checkIndexFromLength` calls to validate arguments across the codebase. Ironically, the `IOUtils` class itself was left out.

This PR addresses that omission by adding argument validation to `IOUtils#read` and `IOUtils#readFully`.

Key points:

* Ensures consistency with the rest of Commons IO by validating `offset` and `length`.
* Fixes inconsistent exception behavior:

  * Previously, `length < 0` resulted in an `IllegalArgumentException`.
  * `offset < 0` did not trigger validation and failed later with an `IndexOutOfBoundsException`.
* With this change, both invalid cases are handled consistently and upfront.

Report URL: https://github.com/apache/commons-io/actions/runs/18230002734

With regards,
GitHub Actions via GitBox