RFR: 8285517: System.getenv() returns unexpected value if environment variable has non ASCII character [v4]

Ichiroh Takiguchi itakiguchi at openjdk.java.net
Thu May 5 08:12:25 UTC 2022


On Thu, 5 May 2022 01:31:24 GMT, Naoto Sato <naoto at openjdk.org> wrote:

>> Ichiroh Takiguchi has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8285517: System.getenv() returns unexpected value if environment variable has non ASCII character
>
> src/java.base/unix/classes/java/lang/ProcessEnvironment.java line 73:
> 
>> 71:         @SuppressWarnings("removal")
>> 72:         String jnuEncoding = AccessController.doPrivileged((PrivilegedAction<String>) ()
>> 73:             -> System.getProperty("sun.jnu.encoding"));
> 
> No need to issue `doPrivileged()`, which is deprecated

Hello @naotoj .
If I just use `System.getProperty("sun.jnu.encoding")`, following testcases were failed.

java/lang/ProcessBuilder/SecurityManagerClinit.java 
java/lang/ProcessHandle/PermissionTest.java 

Please give me your suggestion again.

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

PR: https://git.openjdk.java.net/jdk/pull/8378


More information about the core-libs-dev mailing list