Remove the last bits of the ICU ResourceBundle hack.

This patch switches us over to calling ICU directly for localized currency
symbols, and then removes all the mechanism for sneaking fake ResourceBundle
implementations in. The code's a lot simpler too, because ICU's default
behavior is what we want anyway.
diff --git a/libcore/icu/src/main/java/com/ibm/icu4jni/util/Resources.java b/libcore/icu/src/main/java/com/ibm/icu4jni/util/Resources.java
index efc55d1..f1c50e3 100644
--- a/libcore/icu/src/main/java/com/ibm/icu4jni/util/Resources.java
+++ b/libcore/icu/src/main/java/com/ibm/icu4jni/util/Resources.java
@@ -91,17 +91,6 @@
         return result;
     }
 
-    // TODO: fix remaining caller and remove this.
-    public static ResourceBundle getInstance(String bundleName, String locale) {
-        if (locale == null) {
-            locale = Locale.getDefault().toString();
-        }
-        if (bundleName.startsWith("Currency")) {
-            return new CurrencyResourceBundle(locale);
-        }
-        throw new AssertionError("bundle="+bundleName+" locale="+locale);
-    }
-
     /**
      * Returns an array of ISO language names (two-letter codes), fetched either
      * from ICU's database or from our memory cache.
@@ -275,36 +264,6 @@
         return result;
     }
 
-    // --- Specialized ResourceBundle subclasses ------------------------------
-
-    /**
-     * Internal ResourceBundle mimicking the Harmony "Currency_*" bundles. Keys
-     * are the three-letter ISO currency codes. Values are the printable
-     * currency names in terms of the specified locale. An example entry is
-     * "USD"->"$" (for inside the US) and "USD->"US$" (for outside the US).
-     */
-    private static final class CurrencyResourceBundle extends ResourceBundle {
-
-        private String locale;
-
-        public CurrencyResourceBundle(String locale) {
-            super();
-            this.locale = locale;
-        }
-
-        @Override
-        public Enumeration<String> getKeys() {
-            // Won't get used
-            throw new UnsupportedOperationException();
-        }
-
-        @Override
-        protected Object handleGetObject(String key) {
-            return getCurrencySymbolNative(locale, key);
-        }
-
-    }
-
     // --- Native methods accessing ICU's database ----------------------------
 
     public static native String getDisplayCountryNative(String countryCode, String locale);
diff --git a/libcore/luni/src/main/java/java/util/Currency.java b/libcore/luni/src/main/java/java/util/Currency.java
index 9ce92f6..e6b0202 100644
--- a/libcore/luni/src/main/java/java/util/Currency.java
+++ b/libcore/luni/src/main/java/java/util/Currency.java
@@ -105,7 +105,7 @@
             country = country + "_" + variant;
         }
 
-        String currencyCode = com.ibm.icu4jni.util.Resources.getCurrencyCodeNative(country);
+        String currencyCode = Resources.getCurrencyCodeNative(country);
         if (currencyCode == null) {
             throw new IllegalArgumentException(Msg.getString("K0323", locale.toString()));
         } else if (currencyCode.equals("None")) {
@@ -138,18 +138,14 @@
 
     /**
      * Returns the symbol for this currency in the given {@code Locale}.
+     * That is, given "USD" and Locale.US, you'd get "$", but given "USD" and a non-US locale,
+     * you'd get "US$".
      * <p>
-     * If the locale doesn't have any countries (e.g.
+     * If the locale only specifies a language rather than a language and a countries (e.g.
      * {@code Locale.JAPANESE, new Locale("en","")}), the the ISO
      * 4217 currency code is returned.
      * <p>
-     * First the locale's resource bundle is checked, if the locale has the same currency,
-     * the CurrencySymbol in this locale bundle is returned.
-     * <p>
-     * Then a currency bundle for this locale is searched.
-     * <p>
-     * If a currency bundle for this locale does not exist, or there is no
-     * symbol for this currency in this bundle, then the
+     * If there is no currency symbol specific to this locale does not exist, the
      * ISO 4217 currency code is returned.
      * <p>
      *
@@ -165,32 +161,12 @@
         }
 
         // Check the locale first, in case the locale has the same currency.
-        LocaleData localeData = com.ibm.icu4jni.util.Resources.getLocaleData(locale);
+        LocaleData localeData = Resources.getLocaleData(locale);
         if (localeData.internationalCurrencySymbol.equals(currencyCode)) {
             return localeData.currencySymbol;
         }
 
-        // check if the currency bundle for this locale has an entry for this currency
-        try {
-            ResourceBundle currencyBundle = getCurrencyBundle(locale);
-
-            // is the bundle found for a different country? (for instance the
-            // default locale's currency bundle)
-            if (!currencyBundle.getLocale().getCountry().equals(locale.getCountry())) {
-                // TODO: the fact I never see output from this when running the tests suggests we
-                // don't have a test for this. Does it ever even happen? If it does, can we just
-                // ask ICU a slightly different question to get the behavior we want?
-                Logger.global.info("currencyBundle " + currencyBundle + " for " + locale +
-                        " came back with locale " + currencyBundle.getLocale());
-                return currencyCode;
-            }
-
-            // Return the currency bundle's value, or currencyCode.
-            String result = (String) currencyBundle.handleGetObject(currencyCode);
-            return (result != null) ? result : currencyCode;
-        } catch (MissingResourceException e) {
-            return currencyCode;
-        }
+        return Resources.getCurrencySymbolNative(locale.toString(), currencyCode);
         // END android-changed
     }
 
diff --git a/libcore/luni/src/main/java/java/util/ResourceBundle.java b/libcore/luni/src/main/java/java/util/ResourceBundle.java
index 218d3f3..ec669d6 100644
--- a/libcore/luni/src/main/java/java/util/ResourceBundle.java
+++ b/libcore/luni/src/main/java/java/util/ResourceBundle.java
@@ -24,7 +24,6 @@
 
 // BEGIN android-changed
 // import org.apache.harmony.kernel.vm.VM;
-import com.ibm.icu4jni.util.Resources;
 import dalvik.system.VMStack;
 // END android-changed
 import org.apache.harmony.luni.util.Msg;
@@ -355,25 +354,11 @@
         }
 
         try {
-            // BEGIN android-changed
-            /*
-             * Intercept loading of ResourceBundles that contain Harmony
-             * I18N data. Deliver our special, ICU-based bundles in this case.
-             * All other ResourceBundles use the ordinary mechanism, so user
-             * code behaves as it should.
-             */
-            if(bundleName.startsWith("org.apache.harmony.luni.internal.locale.")) {
-                String icuBundleName = bundleName.substring(40);
-                String icuLocale = (locale.length() > 0 ? locale.substring(1) : locale);
-                // we know that Resources will deliver an assignable class
-                bundle = Resources.getInstance(icuBundleName, icuLocale);
-            } else {
-                Class<?> bundleClass = Class.forName(bundleName, true, loader);
-                if (ResourceBundle.class.isAssignableFrom(bundleClass)) {
-                    bundle = (ResourceBundle) bundleClass.newInstance();
-                }
+            Class<?> bundleClass = Class.forName(bundleName, true, loader);
+            
+            if (ResourceBundle.class.isAssignableFrom(bundleClass)) {
+                bundle = (ResourceBundle) bundleClass.newInstance();
             }
-            // END android-changed
         } catch (LinkageError e) {
         } catch (Exception e) {
         }