Also fix ICU-12620 which is mark duplicate of ICU-9972 just now.
and fix ICU-22258.
Separate the new year and winter solstice cache since the calculated
value for these two calendar are mostly but not always the same due
to slightly different observation timeZone.
Remove the epochYear and zoneAstroCalc from the member data
and instead return them from a getStting() method with the two caches
since all four of them are constant per subclass of ChineseCalendar
and do not need to be different per object.
The known issues in the TestLimit is caused by both Calendar get/put the
value from the same cache while the calculated result depends on the
timeZone zoneAstroCalc.
Revise uses of UVector in rbtz.cpp to better handle memory allocation failures.
This is one of an ongoing series of commits to address similar problems with
UVector usage throughout ICU.
The changes include
- Use LocalPointers and UVector deleter functions to simplify OOM checking and recovery.
- Fix RuleBasedTimeZone::addTransitionRule(rule) to have standard ICU adopt behavior
when errors occur, meaning automatic deletion of the incoming rule. This simplifies
both the implementation of the function and the code at the call sites.
- Update addTransitionRule() call sites. Includes modifying the Dangi calendar initializtion
to not silently ignore errors.
- struct Transition is changed to derive from UMemory, which allows the use of LocalPointers.