RFR: 8378118: Test tools/jimage/JImageBadFileTest.java failed on Windows

David Beaumont duke at openjdk.org
Thu Feb 19 10:53:28 UTC 2026


On Thu, 19 Feb 2026 07:33:16 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Removed the manual file tidyup on the expectation that jtreg will sort that all out.
>> Switched to using Utils.createTempFile() while I was there.
>
> test/jdk/tools/jimage/JImageBadFileTest.java line 82:
> 
>> 80:             throws IOException {
>> 81:         int remaining = maxLen >= 0 ? maxLen : Integer.MAX_VALUE;
>> 82:         Path dst = Utils.createTempFile("modules-" + label, "");
> 
> Just curious why this is changed.

It's just the more idiomatic way to make temp files in tests, since it hides any semantics related to knowing that the current working directory is the correct place for temporary files. Fewer details in the test code itself.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29783#discussion_r2827045289


More information about the core-libs-dev mailing list