RFR: 8372155: ReleaseInfoPlugin doesn't handle input file as UTF-8 properly [v4]

Alan Bateman alanb at openjdk.org
Mon Nov 24 15:01:58 UTC 2025


On Thu, 20 Nov 2025 15:24:21 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>> Please review this simple fix to `jlink`'s `--release-info` plugin to handle non-ASCII in vendor strings. The JDK build uses UTF-8 encoding for the produced `release` file that is being passed to `jlink` at build-time via the `--release-info` plugin. However, the plugin internally uses `java.util.Properties.load(InputStream)` API which assumes `ISO-8859-1` encoding of the input stream. The proposed fix is to use the `java.util.Prorperties.load(Reader)` API instead and pass it an `InputStreamReader` with `UTF-8` encoding.
>> 
>> Testing:
>> - [x] GHA
>> - [x] `test/jdk/tools/jlink` tests including the new reg-test which fails prior and passes after the fix.
>> 
>> Thoughts?
>
> Severin Gehwolf has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Copyright updates.

All okay, just a minor comment on a var usage in the test.

test/jdk/tools/jlink/plugins/ReleaseInfoPluginTest.java line 71:

> 69:         // release file produced should have IMPLEMENTOR in
> 70:         // UTF-8 encoding
> 71:         var release = image.resolve("release");

I probably wouldn't use `var` here because it's not clear because "release" or the method gives no indication that the type is Path here.

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

Marked as reviewed by alanb (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28399#pullrequestreview-3500848816
PR Review Comment: https://git.openjdk.org/jdk/pull/28399#discussion_r2556633821


More information about the core-libs-dev mailing list