<i18n dev> RFR: 8041488: Locale-Dependent List Patterns [v15]

Naoto Sato naoto at openjdk.org
Fri Sep 8 17:48:47 UTC 2023


On Fri, 8 Sep 2023 14:43:59 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Naoto Sato 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 24 additional commits since the last revision:
>> 
>>  - Reflects review comments
>>  - Merge branch 'master' into JDK-8041488-ListPatterns-PR
>>  - Incorporating suggested changes
>>  - Update src/java.base/share/classes/java/text/ListFormat.java
>>    
>>    Co-authored-by: Roger Riggs <Roger.Riggs at Oracle.com>
>>  - Update src/java.base/share/classes/java/text/ListFormat.java
>>    
>>    Co-authored-by: Roger Riggs <Roger.Riggs at Oracle.com>
>>  - Update src/java.base/share/classes/sun/util/locale/provider/LocaleResources.java
>>    
>>    Co-authored-by: Roger Riggs <Roger.Riggs at Oracle.com>
>>  - Removing unnecessary commas
>>  - Added tests
>>  - Review comments
>>  - Merge branch 'master' into JDK-8041488-ListPatterns-PR
>>  - ... and 14 more: https://git.openjdk.org/jdk/compare/fa1dfefb...bce82a4f
>
> src/java.base/share/classes/java/text/ListFormat.java line 536:
> 
>> 534:         try {
>> 535:             init();
>> 536:         } catch (IllegalArgumentException iae) {
> 
> If the `patterns` array contains a null, perhaps due to corrupted stream contents, `init()` will throw NPE.
> I don't recommend catching NPE here, but perhaps `init()` should check for nulls and throw IAE.

Actually, null checks for the `patterns` array elements should be done also for the 1-arg factory method. Will add the check in `init()` and the corresponding test.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1320169657


More information about the i18n-dev mailing list