[jdk8u-dev] RFR: 8287107: CgroupSubsystemFactory.setCgroupV2Path asserts with freezer controller [v2]

Andrew John Hughes andrew at openjdk.org
Fri Jan 27 22:07:24 UTC 2023


On Fri, 27 Jan 2023 09:23:27 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>> Not a clean backport due to changes in test - `Files.writeString(a, b)` => `Files.write(a, b.getBytes())` - and some copyright and `@bug` lines. Fixed manually.
>> 
>> Testing: Linux x86_64 fastdebug (reg-test fails prior and passes after product fix).
>
> Severin Gehwolf has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains one commit:
> 
>   8287107: CgroupSubsystemFactory.setCgroupV2Path asserts with freezer controller
>   
>   Backport-of: 704b9a66bba0dc8adb62be80fd62864b9c687c3f

I think it should be `Files.writeString(a, b) => Files.write(a, b.getBytes(StandardCharsets.UTF_8))` rather than `Files.writeString(a, b) => Files.write(a, b.getBytes())`. `Files.writeString(a,b)` is a shorthand for `Files.writeString(a, b, StandardCharsets.UTF_8)`, while `getBytes()` with [no arguments](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#getBytes--) will use the platform default character set. This could lead to different behaviour with the default character set is not ASCII or UTF-8.

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

PR: https://git.openjdk.org/jdk8u-dev/pull/218


More information about the jdk8u-dev mailing list