RFR: CODETOOLS-7903331: jtreg fails with StringIndexOutOfBoundsException: Index -1 out of bounds for length 0

Iris Clark iris at openjdk.org
Tue Oct 11 22:59:32 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.

Marked as reviewed by iris (Reviewer).

-------------

PR: https://git.openjdk.org/jtreg/pull/131


More information about the jtreg-dev mailing list