rt/emul/compact/src/main/java/java/text/NumberFormat.java
changeset 1339 8cc04f85a683
parent 1334 588d5bf7a560
     1.1 --- a/rt/emul/compact/src/main/java/java/text/NumberFormat.java	Thu Oct 03 15:40:35 2013 +0200
     1.2 +++ b/rt/emul/compact/src/main/java/java/text/NumberFormat.java	Fri Oct 04 11:07:00 2013 +0200
     1.3 @@ -44,7 +44,6 @@
     1.4  import java.io.ObjectOutputStream;
     1.5  import java.math.BigInteger;
     1.6  import java.math.RoundingMode;
     1.7 -import java.text.spi.NumberFormatProvider;
     1.8  import java.util.Currency;
     1.9  import java.util.HashMap;
    1.10  import java.util.Hashtable;
    1.11 @@ -53,9 +52,6 @@
    1.12  import java.util.ResourceBundle;
    1.13  import java.util.concurrent.atomic.AtomicInteger;
    1.14  import java.util.concurrent.atomic.AtomicLong;
    1.15 -import java.util.spi.LocaleServiceProvider;
    1.16 -import sun.util.LocaleServiceProviderPool;
    1.17 -import sun.util.resources.LocaleData;
    1.18  
    1.19  /**
    1.20   * <code>NumberFormat</code> is the abstract base class for all number
    1.21 @@ -393,8 +389,7 @@
    1.22          return getInstance(inLocale, NUMBERSTYLE);
    1.23      }
    1.24  
    1.25 -    /**
    1.26 -     * Returns a general-purpose number format for the current default locale.
    1.27 +    /**     * Returns a general-purpose number format for the current default locale.
    1.28       */
    1.29      public final static NumberFormat getNumberInstance() {
    1.30          return getInstance(Locale.getDefault(Locale.Category.FORMAT), NUMBERSTYLE);
    1.31 @@ -495,9 +490,10 @@
    1.32       *         <code>NumberFormat</code> instances are available.
    1.33       */
    1.34      public static Locale[] getAvailableLocales() {
    1.35 -        LocaleServiceProviderPool pool =
    1.36 -            LocaleServiceProviderPool.getPool(NumberFormatProvider.class);
    1.37 -        return pool.getAvailableLocales();
    1.38 +        return new Locale[] { Locale.US };
    1.39 +//        LocaleServiceProviderPool pool =
    1.40 +//            LocaleServiceProviderPool.getPool(NumberFormatProvider.class);
    1.41 +//        return pool.getAvailableLocales();
    1.42      }
    1.43  
    1.44      /**
    1.45 @@ -743,26 +739,26 @@
    1.46                                             int choice) {
    1.47          // Check whether a provider can provide an implementation that's closer
    1.48          // to the requested locale than what the Java runtime itself can provide.
    1.49 -        LocaleServiceProviderPool pool =
    1.50 -            LocaleServiceProviderPool.getPool(NumberFormatProvider.class);
    1.51 -        if (pool.hasProviders()) {
    1.52 -            NumberFormat providersInstance = pool.getLocalizedObject(
    1.53 -                                    NumberFormatGetter.INSTANCE,
    1.54 -                                    desiredLocale,
    1.55 -                                    choice);
    1.56 -            if (providersInstance != null) {
    1.57 -                return providersInstance;
    1.58 -            }
    1.59 -        }
    1.60 +//        LocaleServiceProviderPool pool =
    1.61 +//            LocaleServiceProviderPool.getPool(NumberFormatProvider.class);
    1.62 +//        if (pool.hasProviders()) {
    1.63 +//            NumberFormat providersInstance = pool.getLocalizedObject(
    1.64 +//                                    NumberFormatGetter.INSTANCE,
    1.65 +//                                    desiredLocale,
    1.66 +//                                    choice);
    1.67 +//            if (providersInstance != null) {
    1.68 +//                return providersInstance;
    1.69 +//            }
    1.70 +//        }
    1.71  
    1.72          /* try the cache first */
    1.73          String[] numberPatterns = (String[])cachedLocaleData.get(desiredLocale);
    1.74 -        if (numberPatterns == null) { /* cache miss */
    1.75 -            ResourceBundle resource = LocaleData.getNumberFormatData(desiredLocale);
    1.76 -            numberPatterns = resource.getStringArray("NumberPatterns");
    1.77 -            /* update cache */
    1.78 -            cachedLocaleData.put(desiredLocale, numberPatterns);
    1.79 -        }
    1.80 +//        if (numberPatterns == null) { /* cache miss */
    1.81 +//            ResourceBundle resource = LocaleData.getNumberFormatData(desiredLocale);
    1.82 +//            numberPatterns = resource.getStringArray("NumberPatterns");
    1.83 +//            /* update cache */
    1.84 +//            cachedLocaleData.put(desiredLocale, numberPatterns);
    1.85 +//        }
    1.86  
    1.87          DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(desiredLocale);
    1.88          int entry = (choice == INTEGERSTYLE) ? NUMBERSTYLE : choice;
    1.89 @@ -1130,7 +1126,7 @@
    1.90  
    1.91      /**
    1.92       * Obtains a NumberFormat instance from a NumberFormatProvider implementation.
    1.93 -     */
    1.94 +     *
    1.95      private static class NumberFormatGetter
    1.96          implements LocaleServiceProviderPool.LocalizedObjectGetter<NumberFormatProvider,
    1.97                                                                     NumberFormat> {
    1.98 @@ -1159,4 +1155,5 @@
    1.99              return null;
   1.100          }
   1.101      }
   1.102 +    */
   1.103  }