Re: RFR: 8333827: JDK 23 RDP1 L10n resource files update

2024-06-10 Thread Joe Wang
On Fri, 7 Jun 2024 22:46:44 GMT, Damon Nguyen  wrote:

> This issue is responsible for updating the translations of all the 
> localize(able) resources in the JDK. Primarily, the changes between JDK 22 
> RDP 1 and the integration of the JDK 23 RDP 1 L10n drop will be translated.
> 
> The translation tool adjusted some definitions, which causes some changes in 
> localized files where the source file had no changes. This causes some words 
> being reverted from localized languages to English, and some had its 
> definitions changed.
> 
> Alternatively, the diffs are viewable here and was generated using Jonathan 
> Gibbons' diff tool for l10n:
> https://cr.openjdk.org/~dnguyen/output2/

One minor comment, otherwise the java.xml changes look good.

src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties
 line 331:

> 329: 
> 330: # Implementation Property DTD
> 331: JDK_DTD_DENY = JAXP00010008: DOCTYPE ist nicht zulässig, wenn 
> die DTD-Eigenschaft auf "Ablehnen" gesetzt wurde. Weitere Informationen: 
> Eigenschaft jdk.xml.dtd.support in java.xml/module-summary.

either drop the double quote in "Ablehnen" or use the literal without 
translation, that is, "deny".

-

Marked as reviewed by joehw (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19609#pullrequestreview-2108813421
PR Review Comment: https://git.openjdk.org/jdk/pull/19609#discussion_r1633870136


Re: RFR: 8325558: Add jcheck whitespace checking for properties files

2024-02-12 Thread Joe Wang
On Fri, 9 Feb 2024 13:35:55 GMT, Magnus Ihse Bursie  wrote:

> This is an attempt to finally implement the idea brought forward in 
> JDK-8295729:  Properties files is essentially source code. It should have the 
> same whitespace checks as all other source code, so we don't get spurious 
> trailing whitespace changes or leading tabs instead of spaces. 
> 
> With Skara jcheck, it is possible to increase the coverage of the whitespace 
> checks.
> 
> However, this turned out to be problematic, since trailing whitespace is 
> significant in properties files. That issue has mostly been sorted out in a 
> series of PRs, and this patch will finish the job with the few remaining 
> files, and actually enable the check in jcheck.

java.xml changes look fine to me.

-

Marked as reviewed by joehw (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/17789#pullrequestreview-1876181019


Re: RFR: 8325558: Add jcheck whitespace checking for properties files

2024-02-12 Thread Joe Wang
On Fri, 9 Feb 2024 13:46:06 GMT, Magnus Ihse Bursie  wrote:

>> This is an attempt to finally implement the idea brought forward in 
>> JDK-8295729:  Properties files is essentially source code. It should have 
>> the same whitespace checks as all other source code, so we don't get 
>> spurious trailing whitespace changes or leading tabs instead of spaces. 
>> 
>> With Skara jcheck, it is possible to increase the coverage of the whitespace 
>> checks.
>> 
>> However, this turned out to be problematic, since trailing whitespace is 
>> significant in properties files. That issue has mostly been sorted out in a 
>> series of PRs, and this patch will finish the job with the few remaining 
>> files, and actually enable the check in jcheck.
>
> src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages.properties
>  line 24:
> 
>> 22: # Messages for message reporting
>> 23: BadMessageKey = The error message corresponding to the message key can 
>> not be found.
>> 24: FormatFailed = An internal error occurred while formatting the following 
>> message:\n
> 
> Same here with `:\n`...

It's done with the code (that is, a key is appended with the code). In fact, 
the whole Xerces stack was implemented this way. I'd leave it as is.

-

PR Review Comment: https://git.openjdk.org/jdk/pull/17789#discussion_r1486731927


Re: [jdk20] RFR: 8300719: JDK 20 RDP2 L10n resource files update [v3]

2023-01-24 Thread Joe Wang
On Tue, 24 Jan 2023 22:33:24 GMT, Damon Nguyen  wrote:

>> Open l10n drop. Files have been updated with translated versions. Whitespace 
>> tool has been ran on files.
>> All tests passed
>
> Damon Nguyen has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Change localization codes. Add CNY back

Marked as reviewed by joehw (Reviewer).

java.xml changes look good to me. Thanks.

-

PR: https://git.openjdk.org/jdk20/pull/116


Re: [jdk20] RFR: 8298133: JDK 20 RDP1 L10n resource files update - msgdrop 10 [v4]

2022-12-15 Thread Joe Wang
On Thu, 15 Dec 2022 23:01:35 GMT, Damon Nguyen  wrote:

>> Open l10n drop
>> All tests passed
>
> Damon Nguyen has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Revert double quote as well

The changes in the java.xml area look good to me.

-

Marked as reviewed by joehw (Reviewer).

PR: https://git.openjdk.org/jdk20/pull/35


Re: RFR: 8296546: Add @spec tags to API [v3]

2022-11-23 Thread Joe Wang
On Wed, 23 Nov 2022 18:57:03 GMT, Jonathan Gibbons  wrote:

>> Please review a "somewhat automated" change to insert `@spec` tags into doc 
>> comments, as appropriate, to leverage the recent new javadoc feature to 
>> generate a new page listing the references to all external specifications 
>> listed in the `@spec` tags.
>> 
>> "Somewhat automated" means that I wrote and used a temporary utility to scan 
>> doc comments looking for HTML links to selected sites, such as `ietf.org`, 
>> `unicode.org`, `w3.org`. These links may be in the main description of a doc 
>> comment, or in `@see` tags. For each link, the URL is examined, and 
>> "normalized", and inserted into the doc comment with a new `@spec` tag, 
>> giving the link and tile for the spec.
>> 
>> "Normalized" means...
>> * Use `https:` where possible (includes pretty much all cases)
>> * Use a single consistent host name for all URLs coming from the same spec 
>> site (i.e. don't use different aliases for the same site)
>> * Point to the root page of a multi-page spec
>> * Use a consistent form of the spec, preferring HTML over plain text where 
>> both are available (this mostly applies to IETF specs)
>> 
>> In addition, a "standard" title is determined for all specs,  determined 
>> either from the content of the (main) spec page or from site index pages.
>> 
>> The net effect is (or should be) that **all** the changes are to just 
>> **add** new `@spec` tags, based on the links found in each doc comment. 
>> There should be no other changes to the doc comments, or to the 
>> implementation of any classes and interfaces.
>> 
>> That being said, the utility I wrote does have additional abilities, to 
>> update the links that it finds (e.g. changing to use `https:` etc,) but 
>> those features are _not_ being used here, but could be used in followup PRs 
>> if component teams so desired. I did notice while working on this overall 
>> feature that many of our links do point to "outdated" pages, some with 
>> eye-catching notices declaring that the spec has been superseded. 
>> Determining how, when and where to update such links is beyond the scope of 
>> this PR.
>> 
>> Going forward, it is to be hoped that component teams will maintain the 
>> underlying links, and the URLs in `@spec` tags, such that if references to 
>> external specifications are updated, this will include updating the `@spec` 
>> tags.
>> 
>> To see the effect of all these new `@spec` tags, see 
>> http://cr.openjdk.java.net/~jjg/8296546/api.00/
>> 
>> In particular, see the new [External 
>> Specifications](http://cr.openjdk.java.net/~jjg/8296546/api.00/external-specs.html)
>>  page, which you can also find via the new link near the top of the 
>> [Index](http://cr.openjdk.java.net/~jjg/8296546/api.00/index-files/index-1.html)
>>  pages.
>
> Jonathan Gibbons has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Remove updates from unexported files

Specs for XSLT and XPath (many occurrences) need to point to specific version 
(e.g. 1.0) rather than the "cover page" (this is an issue in the original 
javadoc).

src/java.xml/share/classes/javax/xml/transform/OutputKeys.java line 35:

> 33:  *
> 34:  * @spec https://www.w3.org/TR/xslt xslt cover page - W3C
> 35:  * @see http://www.w3.org/TR/xslt#output";>

The pages for XSLT and XPath at W3C are organized differently from the days 
when this javadoc was created. The "latest version" now points to the "cover 
page". Could you change the spec to the following? 
  https://www.w3.org/TR/1999/REC-xslt-19991116 XSL Transformations (XSLT) 
Version 1.0
  
The @spec points to the general spec while @see also a specific section 
(similar situation as other classes in the package), if we want to keep @see 
ref here, it would be: 
https://www.w3.org/TR/1999/REC-xslt-19991116#output

src/java.xml/share/classes/javax/xml/xpath/XPath.java line 104:

> 102:  * @author  Norman Walsh
> 103:  * @author  Jeff Suttor
> 104:  * @see http://www.w3.org/TR/xpath";>XML Path Language (XPath) 
> Version 1.0

Similar situation as XSLT above, the latest version now points to "cover page". 
For this javadoc then, it needs to be:
https://www.w3.org/TR/1999/REC-xpath-19991116/ XML Path Language (XPath) 
Version 1.0

Unlike XSLT, the original @see ref also points to the spec generally (not a 
specific section), we could then drop it to keep just the @spec ref.

-

PR: https://git.openjdk.org/jdk/pull/11073


Re: RFR: 8296546: Add @spec tags to API [v3]

2022-11-23 Thread Joe Wang
On Wed, 23 Nov 2022 18:57:03 GMT, Jonathan Gibbons  wrote:

>> Please review a "somewhat automated" change to insert `@spec` tags into doc 
>> comments, as appropriate, to leverage the recent new javadoc feature to 
>> generate a new page listing the references to all external specifications 
>> listed in the `@spec` tags.
>> 
>> "Somewhat automated" means that I wrote and used a temporary utility to scan 
>> doc comments looking for HTML links to selected sites, such as `ietf.org`, 
>> `unicode.org`, `w3.org`. These links may be in the main description of a doc 
>> comment, or in `@see` tags. For each link, the URL is examined, and 
>> "normalized", and inserted into the doc comment with a new `@spec` tag, 
>> giving the link and tile for the spec.
>> 
>> "Normalized" means...
>> * Use `https:` where possible (includes pretty much all cases)
>> * Use a single consistent host name for all URLs coming from the same spec 
>> site (i.e. don't use different aliases for the same site)
>> * Point to the root page of a multi-page spec
>> * Use a consistent form of the spec, preferring HTML over plain text where 
>> both are available (this mostly applies to IETF specs)
>> 
>> In addition, a "standard" title is determined for all specs,  determined 
>> either from the content of the (main) spec page or from site index pages.
>> 
>> The net effect is (or should be) that **all** the changes are to just 
>> **add** new `@spec` tags, based on the links found in each doc comment. 
>> There should be no other changes to the doc comments, or to the 
>> implementation of any classes and interfaces.
>> 
>> That being said, the utility I wrote does have additional abilities, to 
>> update the links that it finds (e.g. changing to use `https:` etc,) but 
>> those features are _not_ being used here, but could be used in followup PRs 
>> if component teams so desired. I did notice while working on this overall 
>> feature that many of our links do point to "outdated" pages, some with 
>> eye-catching notices declaring that the spec has been superseded. 
>> Determining how, when and where to update such links is beyond the scope of 
>> this PR.
>> 
>> Going forward, it is to be hoped that component teams will maintain the 
>> underlying links, and the URLs in `@spec` tags, such that if references to 
>> external specifications are updated, this will include updating the `@spec` 
>> tags.
>> 
>> To see the effect of all these new `@spec` tags, see 
>> http://cr.openjdk.java.net/~jjg/8296546/api.00/
>> 
>> In particular, see the new [External 
>> Specifications](http://cr.openjdk.java.net/~jjg/8296546/api.00/external-specs.html)
>>  page, which you can also find via the new link near the top of the 
>> [Index](http://cr.openjdk.java.net/~jjg/8296546/api.00/index-files/index-1.html)
>>  pages.
>
> Jonathan Gibbons has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Remove updates from unexported files

src/java.xml/share/classes/javax/xml/XMLConstants.java line 35:

> 33:  * @spec https://www.w3.org/TR/REC-xml-names Namespaces in XML 1.0 (Third 
> Edition)
> 34:  * @spec https://www.w3.org/TR/xml-names11 Namespaces in XML 1.1 (Second 
> Edition)
> 35:  * @spec https://www.w3.org/TR/xmlschema-1 XML Schema Part 1: Structures 
> Second Edition

Hi Jon,

I would agree with what Alan said earlier that the @see ref can be dropped. 
This particular class (XMLConstants.java [1]) is a good example for that 
argument: in the resulting javadoc, 5 specs were listed in the "External 
Specifications" section, 6 in "See Also:", and then they were listed again for 
each field. That's a lot of duplicates. Adding to the confusion was that the 
@spec and @see were not always the same, e.g. @spec XML 1.0.
points to the fifth edition while @see second.

A minor comment is that the '@spec's were rendered in one line while the @see 
refs a list. I would see the later is easier to read.

[1] 
http://cr.openjdk.java.net/~jjg/8296546/api.00/java.xml/javax/xml/XMLConstants.html

-

PR: https://git.openjdk.org/jdk/pull/11073


Re: RFR: 8294241: Deprecate URL public constructors [v2]

2022-10-28 Thread Joe Wang
On Fri, 28 Oct 2022 14:54:26 GMT, Daniel Fuchs  wrote:

>> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` 
>> to parse or construct any URL.
>> 
>> The `java.net.URL` class does not itself encode or decode any URL components 
>> according to the escaping mechanism defined in RFC2396. It is the 
>> responsibility of the caller to encode any fields, which need to be escaped 
>> prior to calling URL, and also to decode any escaped fields, that are 
>> returned from URL. 
>> 
>> This has lead to many issues in the past.  Indeed, if used improperly, there 
>> is no guarantee that `URL::toString` or `URL::toExternalForm` will lead to a 
>> URL string that can be parsed back into the same URL. This can lead to 
>> constructing misleading URLs. Another issue is with `equals()` and 
>> `hashCode()` which may have to perform a lookup, and do not take 
>> encoding/escaping into account.
>> 
>> In Java SE 1.4 a new class, `java.net.URI`, has been added to mitigate some 
>> of the shortcoming of `java.net.URL`. Conversion methods to create a URL 
>> from a URI were also added. However, it was left up to the developers to use 
>> `java.net.URI`, or not. This RFE proposes to deprecate all public 
>> constructors of `java.net.URL`, in order to provide a stronger warning about 
>> their potential misuses. To construct a URL, using `URI::toURL` should be 
>> preferred.
>> 
>> In order to provide an alternative to the constructors that take a stream 
>> handler as parameter, a new factory method `URL::fromURI(java.net.URI, 
>> java.net.URLStreamHandler)` is provided as  part of this change.
>> 
>> Places in the JDK code base that were constructing `java.net.URL` have been 
>> temporarily annotated with `@SuppressWarnings("deprecation")`.  Some related 
>> issues will be logged to revisit the calling code.
>> 
>> The CSR can be reviewed here: https://bugs.openjdk.org/browse/JDK-8295949
>
> Daniel Fuchs has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains four additional 
> commits since the last revision:
> 
>  - Updated after review comments. In particular var tmp => var => _unused - 
> and avoid var in java.xml
>  - Merge branch 'master' into deprecate-url-ctor-8294241
>  - Fix whitespace issues
>  - 8294241

Thanks Daniel. The java.xml part looks good to me.

-

Marked as reviewed by joehw (Reviewer).

PR: https://git.openjdk.org/jdk/pull/10874


Re: RFR: 8294241: Deprecate URL public constructors

2022-10-27 Thread Joe Wang
On Wed, 26 Oct 2022 16:00:56 GMT, Daniel Fuchs  wrote:

> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` 
> to parse or construct any URL.
> 
> The `java.net.URL` class does not itself encode or decode any URL components 
> according to the escaping mechanism defined in RFC2396. It is the 
> responsibility of the caller to encode any fields, which need to be escaped 
> prior to calling URL, and also to decode any escaped fields, that are 
> returned from URL. 
> 
> This has lead to many issues in the past.  Indeed, if used improperly, there 
> is no guarantee that `URL::toString` or `URL::toExternalForm` will lead to a 
> URL string that can be parsed back into the same URL. This can lead to 
> constructing misleading URLs. Another issue is with `equals()` and 
> `hashCode()` which may have to perform a lookup, and do not take 
> encoding/escaping into account.
> 
> In Java SE 1.4 a new class, `java.net.URI`, has been added to mitigate some 
> of the shortcoming of `java.net.URL`. Conversion methods to create a URL from 
> a URI were also added. However, it was left up to the developers to use 
> `java.net.URI`, or not. This RFE proposes to deprecate all public 
> constructors of `java.net.URL`, in order to provide a stronger warning about 
> their potential misuses. To construct a URL, using `URI::toURL` should be 
> preferred.
> 
> In order to provide an alternative to the constructors that take a stream 
> handler as parameter, a new factory method `URL::fromURI(java.net.URI, 
> java.net.URLStreamHandler)` is provided as  part of this change.
> 
> Places in the JDK code base that were constructing `java.net.URL` have been 
> temporarily annotated with `@SuppressWarnings("deprecation")`.  Some related 
> issues will be logged to revisit the calling code.
> 
> The CSR can be reviewed here: https://bugs.openjdk.org/browse/JDK-8295949

Hi Daniel, if it's not a major improvement, we'd like to keep the java.xml 
module at the JDK 8 code level. Can we remove the 'var' usage in a few java.xml 
classes?

-

PR: https://git.openjdk.org/jdk/pull/10874


Re: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v4]

2022-09-30 Thread Joe Wang
On Fri, 30 Sep 2022 01:11:45 GMT, Joe Darcy  wrote:

>> With the domain change from openjdk.java.net to openjdk.org, references to 
>> URLs in the sources should be updated.
>> 
>> Updates were made using a shell script. I"ll run a copyright updater before 
>> any push.
>
> Joe Darcy has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   http -> https

The ones in java.xml look good to me.

-

Marked as reviewed by joehw (Reviewer).

PR: https://git.openjdk.org/jdk/pull/10501


Re: RFR: 8294321: Fix typos in files under test/jdk/java, test/jdk/jdk, test/jdk/jni [v2]

2022-09-26 Thread Joe Wang
On Mon, 26 Sep 2022 16:51:36 GMT, Michael Ernst  wrote:

>> 8294321: Fix typos in files under test/jdk/java, test/jdk/jdk, test/jdk/jni
>
> Michael Ernst has updated the pull request with a new target base due to a 
> merge or a rebase. The pull request now contains six commits:
> 
>  - Reinstate typos in Apache code that is copied into the JDK
>  - Merge ../jdk-openjdk into typos-typos
>  - Remove file that was removed upstream
>  - Fix inconsistency in capitalization
>  - Undo change in zlip
>  - Fix typos

Thanks for the update!

-

PR: https://git.openjdk.org/jdk/pull/10029


Re: RFR: 8294321: Fix typos in files under test/jdk/java, test/jdk/jdk, test/jdk/jni

2022-09-26 Thread Joe Wang
On Thu, 25 Aug 2022 15:35:53 GMT, Michael Ernst  wrote:

> 8294321: Fix typos in files under test/jdk/java, test/jdk/jdk, test/jdk/jni

We have discussed several times in the past that we don't touch upstream (in 
this case, Apache) code unless the change is essential. In general, if you fix 
a bug in a class, it's fine to fix other non-essential things within the class, 
such as code styles, javadocs, typos as in this case, etc.  Otherwise, I would 
suggest you contribute such changes to the upstream projects.  Thanks.

-

PR: https://git.openjdk.org/jdk/pull/10029