RFR: 7903808: IOOBE in compile action when processing class files only [v2]

Christian Stein cstein at openjdk.org
Mon Sep 9 08:39:51 UTC 2024


> Please review this fix preventing an `IndexOutOfBoundsException` in the compile action when processing class files only.
> 
> As an library used by a test might need `--enable-preview` it is possible that the `insertPos` variable is still assigned with the value `-1`: the `for (String currArg : args) { ... }` loop may exit normally without setting a valid insertion position.
> 
> This change checks for `-1` values and use `0` instead in order to prepend `--enable-preview` and `--source N` before any variadic arguments.

Christian Stein has updated the pull request incrementally with one additional commit since the last revision:

  Add test for 7903808

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

Changes:
  - all: https://git.openjdk.org/jtreg/pull/224/files
  - new: https://git.openjdk.org/jtreg/pull/224/files/ae72eb28..f963fb83

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jtreg&pr=224&range=01
 - incr: https://webrevs.openjdk.org/?repo=jtreg&pr=224&range=00-01

  Stats: 59 lines in 1 file changed: 59 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jtreg/pull/224.diff
  Fetch: git fetch https://git.openjdk.org/jtreg.git pull/224/head:pull/224

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


More information about the jtreg-dev mailing list