]> granicus.if.org Git - icu/commitdiff
ICU-7365 Promote approved data version API to draft 49 in ICU4J
authorMichael Ow <mow@svn.icu-project.org>
Tue, 23 Aug 2011 17:24:11 +0000 (17:24 +0000)
committerMichael Ow <mow@svn.icu-project.org>
Tue, 23 Aug 2011 17:24:11 +0000 (17:24 +0000)
X-SVN-Rev: 30571

icu4j/main/classes/core/src/com/ibm/icu/impl/ICUDataVersion.java

index 5c1f02ac44b1325dd26bcf7064730f6dcf16f6a5..3377f304e9ef87e01d207e7202e8f2ce7694b657 100644 (file)
@@ -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;
-    }
-    
 }