Integrated: CODETOOLS-7903331: jtreg fails with StringIndexOutOfBoundsException: Index -1 out of bounds for length 0
Jonathan Gibbons
jjg at openjdk.org
Wed Oct 12 00:02:22 UTC 2022
On Tue, 11 Oct 2022 22:22:20 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:
> Please review a simple fix, with new test, for a recently discovered issue, such that including "." in a test group (to mean "all tests") caused an exception.
>
> Updating to JT Harness 6+24 improved the reporting of the exception but did not fix the root cause.
>
> The root cause came from jtreg setting an empty path for an "initial URL" in the `Parameters` object.
>
> In `TestManager.getTests` there was already precedent for returning `null` to mean "all tests", for tests specified on the command line. The fix is to extend that precedent to tests found in groups as well.
>
> There is an existing test `GroupTest`, but that one intentionally has an invalid test which should not normally be read, since it causes a parse failure when reading tests. So a new test is added, with different flavors of including "all" tests. In addition, since the original JDK bug was discovered in relation to the new `-report:files` option, the tests are extended to use that option as well.
This pull request has now been integrated.
Changeset: f8c3879b
Author: Jonathan Gibbons <jjg at openjdk.org>
URL: https://git.openjdk.org/jtreg/commit/f8c3879bb0398b7e242d5b1997fbaaafbf37c5ae
Stats: 90 lines in 9 files changed: 73 ins; 0 del; 17 mod
7903331: jtreg fails with StringIndexOutOfBoundsException: Index -1 out of bounds for length 0
Reviewed-by: iris
-------------
PR: https://git.openjdk.org/jtreg/pull/131
More information about the jtreg-dev
mailing list