From e6bd55d12dd14061327e7459e1efd4db74059658 Mon Sep 17 00:00:00 2001 From: Peter Edberg Date: Fri, 4 Apr 2025 10:49:04 -0700 Subject: [PATCH] ICU-22142 Deprecate ICU4C createMetricTon/getMetricTon, ICU4J METRIC_TON --- icu4c/source/i18n/unicode/measunit.h | 12 ++++-------- .../src/main/java/com/ibm/icu/util/MeasureUnit.java | 6 +++--- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/icu4c/source/i18n/unicode/measunit.h b/icu4c/source/i18n/unicode/measunit.h index f0abd4f4f92..5277cca5f14 100644 --- a/icu4c/source/i18n/unicode/measunit.h +++ b/icu4c/source/i18n/unicode/measunit.h @@ -2847,29 +2847,25 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit getTonne(); +#ifndef U_HIDE_DEPRECATED_API /** * Returns by pointer, unit of mass: metric-ton * (renamed to tonne in CLDR 42 / ICU 72). * Caller owns returned value and must free it. - * Note: In ICU 74 this will be deprecated in favor of - * createTonne(), which is currently draft but will - * become stable in ICU 74, and which uses the preferred naming. * Also see {@link #getMetricTon()} and {@link #createTonne()}. * @param status ICU error code. - * @stable ICU 54 + * @deprecated ICU 78 use createTonne(UErrorCode &status) */ static MeasureUnit *createMetricTon(UErrorCode &status); /** * Returns by value, unit of mass: metric-ton * (renamed to tonne in CLDR 42 / ICU 72). - * Note: In ICU 74 this will be deprecated in favor of - * getTonne(), which is currently draft but will - * become stable in ICU 74, and which uses the preferred naming. * Also see {@link #createMetricTon()} and {@link #getTonne()}. - * @stable ICU 64 + * @deprecated ICU 78 use getTonne() */ static MeasureUnit getMetricTon(); +#endif /* U_HIDE_DEPRECATED_API */ /** * Returns by pointer, unit of power: gigawatt. diff --git a/icu4j/main/core/src/main/java/com/ibm/icu/util/MeasureUnit.java b/icu4j/main/core/src/main/java/com/ibm/icu/util/MeasureUnit.java index 16cd2842e01..286502895c2 100644 --- a/icu4j/main/core/src/main/java/com/ibm/icu/util/MeasureUnit.java +++ b/icu4j/main/core/src/main/java/com/ibm/icu/util/MeasureUnit.java @@ -1776,10 +1776,10 @@ public class MeasureUnit implements Serializable { /** * Constant for unit of mass: metric-ton (renamed to tonne in CLDR 42 / ICU 72). - * Note: In ICU 74 this will be deprecated in favor of TONNE, which is currently - * draft but will become stable in ICU 74, and which uses the preferred naming. - * @stable ICU 54 + * @internal + * @deprecated This API is ICU internal only. */ + @Deprecated public static final MeasureUnit METRIC_TON = MeasureUnit.internalGetInstance("mass", "tonne"); /**