You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since updating to 2.1.8 I'm seeing the following when calling java.time.ZoneId.of:
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.base/java.time.ZoneRegion.ofId(ZoneRegion.java:121)
at java.base/java.time.ZoneId.of(ZoneId.java:411)
at java.base/java.time.ZoneId.of(ZoneId.java:359)
at Test.main(Test.java:9)
Caused by: java.time.zone.ZoneRulesException: Unable to register zone as one already registered with that ID: ical4j~e13c7b72-7f25-46ce-9ce9-e47946f19498, currently loading from provider: net.fortuna.ical4j.zoneinfo.outlook.OutlookZoneRulesProvider@4c1db628
at java.base/java.time.zone.ZoneRulesProvider.registerProvider0(ZoneRulesProvider.java:324)
at java.base/java.time.zone.ZoneRulesProvider.<clinit>(ZoneRulesProvider.java:191)
... 4 more
This can be replicated with the following:
public static void main(final String[] args)
{
ZoneId.of("Europe/London");
}
With org.mnode.ical4j:ical4j:4.0.0-rc3 declared on the classpath first, before org.mnode.ical4j:ical4j-zoneinfo-outlook:2.1.8
In maven the classpath order seems to come from the order the dependencies are declared.
The providers are then registered in the following order:
The zone IDs for both come from net.fortuna.ical4j.model.DefaultZoneRulesProvider#provideZoneIds which is TimeZoneRegistry.ZONE_IDS.keySet()
i.e. it returns the same set of IDs twice
If the order of providers is reversed (OutlookZoneRulesProvider first) then the first time in provideZoneIds will return an empty Set as it hasn't been populated yet (done in the default constructor for DefaultZoneRulesProvider).
It therefore doesn't register the same set of IDs twice and doesn't fall over.
The text was updated successfully, but these errors were encountered:
Since updating to 2.1.8 I'm seeing the following when calling
java.time.ZoneId.of
:This can be replicated with the following:
With
org.mnode.ical4j:ical4j:4.0.0-rc3
declared on the classpath first, beforeorg.mnode.ical4j:ical4j-zoneinfo-outlook:2.1.8
In maven the classpath order seems to come from the order the dependencies are declared.
The providers are then registered in the following order:
The zone IDs for both come from
net.fortuna.ical4j.model.DefaultZoneRulesProvider#provideZoneIds
which isTimeZoneRegistry.ZONE_IDS.keySet()
i.e. it returns the same set of IDs twice
If the order of providers is reversed (
OutlookZoneRulesProvider
first) then the first time inprovideZoneIds
will return an emptySet
as it hasn't been populated yet (done in the default constructor forDefaultZoneRulesProvider
).It therefore doesn't register the same set of IDs twice and doesn't fall over.
The text was updated successfully, but these errors were encountered: