On Fri, 6 May 2022 15:13:38 GMT, Roger Riggs <rri...@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
> test/jdk/java/lang/ProcessBuilder/Basic.java line 606:
>> 604:                 ? Charset.forName(jnuEncoding, Charset.defaultCharset())
>> 605:                 : Charset.defaultCharset();
>> 606:             if (new String(tested.getBytes(cs), cs).equals(tested)) {
> Isn't it always true that the round trip encoding to bytes and back (using 
> the same Charset) to a string is equal()?
> And if it is always true, then the if(...) can be removed.

Above code is related to following code:
If `Charset.defaultCharset()` is `UTF-8`, this code is not skipped.
I think this code will be skipped on JDK17 on C locale.


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

Reply via email to