From bb822ba38a8b8e0ebd33d8311579043bd7978794 Mon Sep 17 00:00:00 2001 From: Younies Date: Wed, 9 Mar 2022 18:24:44 +0000 Subject: [PATCH] ICU-21936 Make the internal units converters public See #2021 --- icu4c/source/i18n/units_complexconverter.h | 4 +++- .../src/com/ibm/icu/impl/units/ComplexUnitsConverter.java | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/icu4c/source/i18n/units_complexconverter.h b/icu4c/source/i18n/units_complexconverter.h index 5c669b45ddd..d56ce8d4ce3 100644 --- a/icu4c/source/i18n/units_complexconverter.h +++ b/icu4c/source/i18n/units_complexconverter.h @@ -108,13 +108,15 @@ class U_I18N_API ComplexUnitsConverter : public UMemory { MaybeStackVector convert(double quantity, icu::number::impl::RoundingImpl *rounder, UErrorCode &status) const; - private: + // TODO(ICU-21937): Make it private after submitting the public units conversion API. MaybeStackVector unitsConverters_; + // TODO(ICU-21937): Make it private after submitting the public units conversion API. // Individual units of mixed units, sorted big to small, with indices // indicating the requested output mixed unit order. MaybeStackVector units_; + private: // Sorts units_, which must be populated before calling this, and populates // unitsConverters_. void init(const MeasureUnitImpl &inputUnit, const ConversionRates &ratesInfo, UErrorCode &status); diff --git a/icu4j/main/classes/core/src/com/ibm/icu/impl/units/ComplexUnitsConverter.java b/icu4j/main/classes/core/src/com/ibm/icu/impl/units/ComplexUnitsConverter.java index 853a63ca8f4..af9843a276c 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/impl/units/ComplexUnitsConverter.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/impl/units/ComplexUnitsConverter.java @@ -24,12 +24,15 @@ import com.ibm.icu.util.Measure; public class ComplexUnitsConverter { public static final BigDecimal EPSILON = BigDecimal.valueOf(Math.ulp(1.0)); public static final BigDecimal EPSILON_MULTIPLIER = BigDecimal.valueOf(1).add(EPSILON); - private ArrayList unitsConverters_; + + // TODO(ICU-21937): Make it private after submitting the public units conversion API. + public ArrayList unitsConverters_; /** * Individual units of mixed units, sorted big to small, with indices * indicating the requested output mixed unit order. */ - private List units_; + // TODO(ICU-21937): Make it private after submitting the public units conversion API. + public List units_; private MeasureUnitImpl inputUnit_; /** -- 2.40.0