From dd8732a309f75102151bf554300ee778819c21c6 Mon Sep 17 00:00:00 2001 From: Michael Ow Date: Tue, 23 Aug 2011 17:24:11 +0000 Subject: [PATCH] ICU-7365 Promote approved data version API to draft 49 in ICU4J X-SVN-Rev: 30571 --- .../src/com/ibm/icu/impl/ICUDataVersion.java | 56 +------------------ 1 file changed, 2 insertions(+), 54 deletions(-) diff --git a/icu4j/main/classes/core/src/com/ibm/icu/impl/ICUDataVersion.java b/icu4j/main/classes/core/src/com/ibm/icu/impl/ICUDataVersion.java index 5c1f02ac44b..3377f304e9e 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/impl/ICUDataVersion.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/impl/ICUDataVersion.java @@ -1,6 +1,6 @@ /* ******************************************************************************* -* Copyright (C) 2009-2010, International Business Machines +* Copyright (C) 2009-2011, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************* */ @@ -14,55 +14,14 @@ import com.ibm.icu.util.VersionInfo; public final class ICUDataVersion { private static final String U_ICU_VERSION_BUNDLE = "icuver"; - private static final String U_ICU_STD_BUNDLE = "icustd"; private static final String U_ICU_DATA_KEY = "DataVersion"; - /** - * This function loads up icuver and compares the data version to the wired-in ICU_DATA_VERSION. - * If icuver shows something less than ICU_DATA_VERSION it returns TRUE, else FALSE. The version - * found will be returned in the first fillin parameter (if non-null), and *isModified will be set - * to TRUE if "icustd" is NOT found. Thus, if the data has been repackaged or modified, "icustd" - * (standard ICU) will be missing, and the function will alert the caller that the data is not standard. - * - * @param dataVersionFillin icuver data version information to be filled in if not-null - * @return TRUE if ICU_DATA_VERSION is newer than icuver, else FALSE - */ - public static boolean isDataOlder(VersionInfo dataVersionFillin) { - boolean result = true; - - VersionInfo dataVersion = getDataVersion(); - - if (dataVersion!= null) { - if (dataVersion.compareTo(VersionInfo.ICU_DATA_VERSION) != -1) { - result = false; - } - - if (dataVersionFillin != null) { - dataVersionFillin = VersionInfo.getInstance(dataVersion.toString()); - } - } - - return result; - } - - /** - * This function tests whether "icustd" is available in the data. If the data has been repackaged or modified, "icustd" - * (standard ICU) will be missing, and the function will alert the caller that the data is not standard. - * - * @return TRUE if data has been modified, else FALSE - */ - public static boolean isDataModified() { - if (hasICUSTDBundle()) { - return false; - } - return true; - } - /** * This function retrieves the data version from icuver and returns a VersionInfo object with that version information. * * @return Current icu data version + * @draft ICU 49 */ public static VersionInfo getDataVersion() { UResourceBundle icudatares = null; @@ -75,15 +34,4 @@ public final class ICUDataVersion { return VersionInfo.getInstance(icudatares.getString()); } - - private static boolean hasICUSTDBundle() { - try { - UResourceBundle.getBundleInstance(ICUDataVersion.U_ICU_STD_BUNDLE); - } catch (MissingResourceException ex) { - return false; - } - - return true; - } - }