Re: RFR: 8283620: System.out does not use the encoding/charset specified in the Javadoc [v2]

2022-04-25 Thread Naoto Sato
On Sat, 23 Apr 2022 05:53:17 GMT, David Holmes  wrote:

>> Naoto Sato has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Modified the spec for the new system properties.
>
> src/java.base/share/classes/java/lang/System.java line 774:
> 
>> 772:  * Character encoding name for {@link System#out 
>> System.out}.
>> 773:  * The Java runtime can be started with the system property set 
>> to {@code UTF-8},
>> 774:  * starting it with the property set to another value clears to 
>> undefined behavior.
> 
> _leads_ to undefined behavior

Good catch! Fixed.

-

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


Re: RFR: 8283620: System.out does not use the encoding/charset specified in the Javadoc [v2]

2022-04-25 Thread Alan Bateman
On Fri, 22 Apr 2022 18:14:18 GMT, Naoto Sato  wrote:

>> Promoting the internal system properties for `System.out` and `System.err` 
>> so that users can override the encoding used for those streams to `UTF-8`, 
>> aligning to the `Charset.defaultCharset()`. A CSR has also been drafted.
>
> Naoto Sato has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Modified the spec for the new system properties.

Overall I think this looks good, assuming the typo in the spec ("clears" -> 
"leads") is fixed.

-

Marked as reviewed by alanb (Reviewer).

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


Re: RFR: 8283620: System.out does not use the encoding/charset specified in the Javadoc [v2]

2022-04-25 Thread Alan Bateman
On Sat, 23 Apr 2022 05:55:15 GMT, David Holmes  wrote:

> I think Alan has a typo: "clears" -> "leads"

Apologies, there was a typo in my comment on the PR. I didn't mean for the word 
"clears" to go into the spec.

-

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


Re: RFR: 8283620: System.out does not use the encoding/charset specified in the Javadoc [v2]

2022-04-22 Thread David Holmes
On Fri, 22 Apr 2022 18:10:27 GMT, Naoto Sato  wrote:

>> src/java.base/share/classes/java/lang/System.java line 780:
>> 
>>> 778:  * The property may be set on the command line to the value
>>> 779:  * {@code UTF-8}. Setting the property to a value other than 
>>> {@code UTF-8}
>>> 780:  * leads to unspecified behavior.
>> 
>> I think the proposal to introduce two standard properties is good and is 
>> consistent with the recently introduced native.encoding. I'm not 100% sure 
>> that the sentence "The property may be set on the command line ..." is 
>> appropriate for the spec of standard properties. We got away with that for 
>> file.encoding in implNote but that isn't spec. I think we may have to 
>> replace this with something that says that the Java runtime can be started 
>> with the system property set to "UTF-8", starting it with the property set 
>> to another value clears to undefined behavior.
>
> Thanks, Alan. Modified them as suggested.

I think Alan has a typo: "clears" -> "leads"

-

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


Re: RFR: 8283620: System.out does not use the encoding/charset specified in the Javadoc [v2]

2022-04-22 Thread David Holmes
On Fri, 22 Apr 2022 18:14:18 GMT, Naoto Sato  wrote:

>> Promoting the internal system properties for `System.out` and `System.err` 
>> so that users can override the encoding used for those streams to `UTF-8`, 
>> aligning to the `Charset.defaultCharset()`. A CSR has also been drafted.
>
> Naoto Sato has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Modified the spec for the new system properties.

src/java.base/share/classes/java/lang/System.java line 774:

> 772:  * Character encoding name for {@link System#out System.out}.
> 773:  * The Java runtime can be started with the system property set 
> to {@code UTF-8},
> 774:  * starting it with the property set to another value clears to 
> undefined behavior.

_leads_ to undefined behavior

-

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


Re: RFR: 8283620: System.out does not use the encoding/charset specified in the Javadoc [v2]

2022-04-22 Thread Naoto Sato
> Promoting the internal system properties for `System.out` and `System.err` so 
> that users can override the encoding used for those streams to `UTF-8`, 
> aligning to the `Charset.defaultCharset()`. A CSR has also been drafted.

Naoto Sato has updated the pull request incrementally with one additional 
commit since the last revision:

  Modified the spec for the new system properties.

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8270/files
  - new: https://git.openjdk.java.net/jdk/pull/8270/files/9ef42917..b5bcb870

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8270=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8270=00-01

  Stats: 6 lines in 1 file changed: 0 ins; 2 del; 4 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8270.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8270/head:pull/8270

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


Re: RFR: 8283620: System.out does not use the encoding/charset specified in the Javadoc [v2]

2022-04-22 Thread Naoto Sato
On Fri, 22 Apr 2022 09:31:19 GMT, Alan Bateman  wrote:

>> Naoto Sato has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Modified the spec for the new system properties.
>
> src/java.base/share/classes/java/lang/System.java line 780:
> 
>> 778:  * The property may be set on the command line to the value
>> 779:  * {@code UTF-8}. Setting the property to a value other than 
>> {@code UTF-8}
>> 780:  * leads to unspecified behavior.
> 
> I think the proposal to introduce two standard properties is good and is 
> consistent with the recently introduced native.encoding. I'm not 100% sure 
> that the sentence "The property may be set on the command line ..." is 
> appropriate for the spec of standard properties. We got away with that for 
> file.encoding in implNote but that isn't spec. I think we may have to replace 
> this with something that says that the Java runtime can be started with the 
> system property set to "UTF-8", starting it with the property set to another 
> value clears to undefined behavior.

Thanks, Alan. Modified them as suggested.

-

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