RFR: 7903789: Replace reflective code to access java.lang.Process methods

Jaikiran Pai jpai at openjdk.org
Sun Aug 24 10:14:40 UTC 2025


Can I please get a review of this change which replaces the reflective access to java.lang.Process' methods with direct API calls? This addresses https://bugs.openjdk.org/browse/CODETOOLS-7903789?

We used to access the `pid()` method and the `destroyForcibly()` method reflectively. `pid()` has been available since Java 9 and `destroyForcibly()` since Java 8. A minimum of Java 17 is required to launch the jtreg tool itself. So the reflective use of these APIs is no longer necessary.

No new self tests have been introduced and existing tests continue to pass with this change.

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

Commit messages:
 - 7903789: Replace reflective code to access java.lang.Process methods

Changes: https://git.openjdk.org/jtreg/pull/277/files
  Webrev: https://webrevs.openjdk.org/?repo=jtreg&pr=277&range=00
  Issue: https://bugs.openjdk.org/browse/CODETOOLS-7903789
  Stats: 182 lines in 4 files changed: 0 ins; 167 del; 15 mod
  Patch: https://git.openjdk.org/jtreg/pull/277.diff
  Fetch: git fetch https://git.openjdk.org/jtreg.git pull/277/head:pull/277

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


More information about the jtreg-dev mailing list