Previously, there were separate overrides for the options and
attributes parsing methods in the parser that were used in different
context. (Options can appear in Operator and Markup, while attributes
can appear in Expression and Markup.)
This is a refactoring that eliminates this duplicated code.
To enable it, a builder is added for the internal OptionMap type.
Separately, this patch also explicitly deletes copy constructors
and copy assignment operators for all Builder classes; a bug in an
earlier version of this patch caused me to notice this hadn't been
done. Also explicitly deletes move constructors/assignment operators
with the exception of OptionMap::Builder (OptionMap is non-public,
so that shouldn't cause confusion).
The implementation was keeping a cache of FormatterFactory
objects so that subsequent calls to the same formatter re-use the
same object.
The problem is that this is unsafe, because
`MFFunctionRegistry::getFormatter()` returns a non-const `FormatterFactory*`;
so if the caller deleted the resulting pointer, the formatter cache
would contain a dangling pointer.
This optimization was added because of an ICU4J test that checked for
the presence of the optimization. However, for separate reasons
(making `adoptFormatter()` actually adopt its argument), this test
was already removed.
The caching could be re-added later if that optimization is needed,
but for now, remove it (also, no tests were checking for its presence).
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.
Sometimes getVisibleIDs() method returns a null reference which might happend
because of inaccurate concurrent access. This change attempts to fix this
ICUServiceThreadTest flakiness.
substitution is using a DecimalFormat and its owning rule also has a modulus substitution. Took out a redundant
call to floor(). Added a hack to allow the caller to change the rounding behavior with setRoundingMode().
Added appropriate unit tests. Added additional documentation of the behavior to the API docs.
The original intention behind this test case was to use the root locale,
but ures_getFunctionalEquivalent() is implemented by calling ures_open()
which sets URES_OPEN_LOCALE_DEFAULT_ROOT which will cause the default
locale to be loaded before the root locale.
To avoid that, pick a locale other than the root locale for the test.
Since ICU4C requires C++11 and C11 the char16_t data type can be used
everywhere, as long as the uchar.h header file gets included when
building as C (where it isn't a keyword as in C++), but this doesn't
work on macOS which for unknown reasons lacks the uchar.h header file
and therefore needs a workaround to define char16_t.
Change the logic of handling year in era 0 counting backwards
to depend on a boolean virtual function instead of adding
string comparsion code in the base class to have specific knowledge of
behavior of subclass.