<i18n dev> RFR: 8302983: ZoneRulesProvider.registerProvider() twice will remove provider [v3]

Andrey Turbanov aturbanov at openjdk.org
Sat Feb 25 18:15:05 UTC 2023


On Sat, 25 Feb 2023 00:07:45 GMT, Madjosz <duke at openjdk.org> wrote:

>> Fixes JDK-8302983 (and duplicate JDK-8302898)
>
> Madjosz has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
> 
>   apply review comments

src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java line 319:

> 317:             ZoneRulesProvider old = ZONES.putIfAbsent(zoneId, provider);
> 318:             if (old != null) {
> 319:                 if(!old.equals(provider)) {

Suggestion:

                if (!old.equals(provider)) {

src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java line 322:

> 320:                     // restore old state
> 321:                     ZONES.put(zoneId, old);
> 322:                     provider.provideZoneIds().stream()

Can we drop `.stream()` call and just call `.forEach` directly?

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

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


More information about the i18n-dev mailing list