summaryrefslogtreecommitdiffstats
path: root/icu/src/main
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2010-04-16 14:14:28 -0700
committerElliott Hughes <enh@google.com>2010-04-16 14:48:27 -0700
commit757a7942eed2b0aa457f8517a0259d2ac82c5b18 (patch)
tree00f74b34ca4edeac65d9cb38d8291ee249f5a806 /icu/src/main
parentb988f4652e9325f77c60c5aa4d71a703a0793ec3 (diff)
downloadlibcore-757a7942eed2b0aa457f8517a0259d2ac82c5b18.zip
libcore-757a7942eed2b0aa457f8517a0259d2ac82c5b18.tar.gz
libcore-757a7942eed2b0aa457f8517a0259d2ac82c5b18.tar.bz2
Merge LocaleData and Resources, rename Resources to ICU.
Also move our ICU tests into our little tree of tests. Bug: 2596471 Change-Id: I73b53d74c26ef9bf670f12cac58b51ba61eefead
Diffstat (limited to 'icu/src/main')
-rw-r--r--icu/src/main/java/com/ibm/icu4jni/text/Collator.java1
-rw-r--r--icu/src/main/java/com/ibm/icu4jni/text/NativeBreakIterator.java1
-rw-r--r--icu/src/main/java/com/ibm/icu4jni/util/ICU.java (renamed from icu/src/main/java/com/ibm/icu4jni/util/Resources.java)100
-rw-r--r--icu/src/main/java/com/ibm/icu4jni/util/LocaleData.java104
-rw-r--r--icu/src/main/native/BidiWrapper.cpp1
-rw-r--r--icu/src/main/native/ICU.cpp (renamed from icu/src/main/native/Resources.cpp)60
-rw-r--r--icu/src/main/native/NativeBreakIterator.cpp2
-rw-r--r--icu/src/main/native/NativeCollation.cpp2
-rw-r--r--icu/src/main/native/NativeConverter.cpp2
-rw-r--r--icu/src/main/native/NativeDecimalFormat.cpp1
-rw-r--r--icu/src/main/native/NativeIDN.cpp2
-rw-r--r--icu/src/main/native/NativeNormalizer.cpp2
-rw-r--r--icu/src/main/native/NativeRegEx.cpp2
-rw-r--r--icu/src/main/native/UCharacter.cpp1
-rw-r--r--icu/src/main/native/sub.mk2
15 files changed, 134 insertions, 149 deletions
diff --git a/icu/src/main/java/com/ibm/icu4jni/text/Collator.java b/icu/src/main/java/com/ibm/icu4jni/text/Collator.java
index 3673d32..7883d30 100644
--- a/icu/src/main/java/com/ibm/icu4jni/text/Collator.java
+++ b/icu/src/main/java/com/ibm/icu4jni/text/Collator.java
@@ -11,7 +11,6 @@
package com.ibm.icu4jni.text;
import com.ibm.icu4jni.text.RuleBasedCollator;
-import com.ibm.icu4jni.util.Resources;
import java.util.Locale;
/**
diff --git a/icu/src/main/java/com/ibm/icu4jni/text/NativeBreakIterator.java b/icu/src/main/java/com/ibm/icu4jni/text/NativeBreakIterator.java
index 91f2beb..272d525 100644
--- a/icu/src/main/java/com/ibm/icu4jni/text/NativeBreakIterator.java
+++ b/icu/src/main/java/com/ibm/icu4jni/text/NativeBreakIterator.java
@@ -16,7 +16,6 @@
package com.ibm.icu4jni.text;
-import com.ibm.icu4jni.util.Resources;
import java.text.CharacterIterator;
import java.text.StringCharacterIterator;
import java.util.Locale;
diff --git a/icu/src/main/java/com/ibm/icu4jni/util/Resources.java b/icu/src/main/java/com/ibm/icu4jni/util/ICU.java
index 874d9be..b684068 100644
--- a/icu/src/main/java/com/ibm/icu4jni/util/Resources.java
+++ b/icu/src/main/java/com/ibm/icu4jni/util/ICU.java
@@ -16,26 +16,14 @@
package com.ibm.icu4jni.util;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.ListResourceBundle;
import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
import java.util.TimeZone;
import java.util.logging.Logger;
/**
* Makes ICU data accessible to Java.
- *
- * TODO: move the LocaleData stuff into LocaleData and rename this class.
*/
-public final class Resources {
- // A cache for the locale-specific data.
- private static final HashMap<String, LocaleData> localeDataCache =
- new HashMap<String, LocaleData>();
-
+public final class ICU {
/**
* Cache for ISO language names.
*/
@@ -52,49 +40,6 @@ public final class Resources {
private static String[] availableTimezones;
/**
- * Returns a shared LocaleData for the given locale.
- */
- public static LocaleData getLocaleData(Locale locale) {
- if (locale == null) {
- locale = Locale.getDefault();
- }
- String localeName = locale.toString();
- synchronized (localeDataCache) {
- LocaleData localeData = localeDataCache.get(localeName);
- if (localeData != null) {
- return localeData;
- }
- }
- LocaleData newLocaleData = makeLocaleData(locale);
- synchronized (localeDataCache) {
- LocaleData localeData = localeDataCache.get(localeName);
- if (localeData != null) {
- return localeData;
- }
- localeDataCache.put(localeName, newLocaleData);
- return newLocaleData;
- }
- }
-
- private static LocaleData makeLocaleData(Locale locale) {
- String language = locale.getLanguage();
- String country = locale.getCountry();
- String variant = locale.getVariant();
- // Start with data from the parent (next-most-specific) locale...
- LocaleData result = new LocaleData();
- if (variant.length() > 0) {
- result.overrideWithDataFrom(getLocaleData(new Locale(language, country, "")));
- } else if (country.length() > 0) {
- result.overrideWithDataFrom(getLocaleData(new Locale(language, "", "")));
- } else if (language.length() > 0) {
- result.overrideWithDataFrom(getLocaleData(Locale.ROOT));
- }
- // Override with data from this locale.
- result.overrideWithDataFrom(initLocaleData(locale));
- return result;
- }
-
- /**
* Returns an array of ISO language names (two-letter codes), fetched either
* from ICU's database or from our memory cache.
*
@@ -104,7 +49,6 @@ public final class Resources {
if (isoLanguages == null) {
isoLanguages = getISOLanguagesNative();
}
-
return isoLanguages.clone();
}
@@ -118,7 +62,6 @@ public final class Resources {
if (isoCountries == null) {
isoCountries = getISOCountriesNative();
}
-
return isoCountries.clone();
}
@@ -129,11 +72,9 @@ public final class Resources {
* @return The array.
*/
public static String[] getKnownTimezones() {
- // TODO Drop the Linux ZoneInfo stuff in favor of ICU.
if (availableTimezones == null) {
availableTimezones = TimeZone.getAvailableIDs();
}
-
return availableTimezones.clone();
}
@@ -233,8 +174,7 @@ public final class Resources {
result[i][4] = arrayToFill[4][i];
}
- Logger.getLogger(Resources.class.getSimpleName()).info(
- "Loaded time zone names for " + locale + " in "
+ Logger.global.info("Loaded time zone names for " + locale + " in "
+ (System.currentTimeMillis() - start) + "ms.");
return result;
@@ -348,6 +288,10 @@ public final class Resources {
private static native String[] getAvailableLocalesNative();
private static native String[] getAvailableNumberFormatLocalesNative();
+ public static native String getCurrencyCodeNative(String locale);
+ public static native int getCurrencyFractionDigitsNative(String currencyCode);
+ public static native String getCurrencySymbolNative(String locale, String currencyCode);
+
public static native String getDisplayCountryNative(String countryCode, String locale);
public static native String getDisplayLanguageNative(String languageCode, String locale);
public static native String getDisplayVariantNative(String variantCode, String locale);
@@ -355,11 +299,6 @@ public final class Resources {
public static native String getISO3CountryNative(String locale);
public static native String getISO3LanguageNative(String locale);
- public static native String getCurrencyCodeNative(String locale);
- public static native String getCurrencySymbolNative(String locale, String currencyCode);
-
- public static native int getCurrencyFractionDigitsNative(String currencyCode);
-
private static native String[] getISOLanguagesNative();
private static native String[] getISOCountriesNative();
@@ -368,30 +307,5 @@ public final class Resources {
private static native String getDisplayTimeZoneNative(String id, boolean isDST, int style,
String locale);
- private static LocaleData initLocaleData(Locale locale) {
- LocaleData localeData = new LocaleData();
- if (!initLocaleDataImpl(locale.toString(), localeData)) {
- throw new AssertionError("couldn't initialize LocaleData for locale " + locale);
- }
- if (localeData.fullTimeFormat != null) {
- // There are some full time format patterns in ICU that use the pattern character 'v'.
- // Java doesn't accept this, so we replace it with 'z' which has about the same result
- // as 'v', the timezone name.
- // 'v' -> "PT", 'z' -> "PST", v is the generic timezone and z the standard tz
- // "vvvv" -> "Pacific Time", "zzzz" -> "Pacific Standard Time"
- localeData.fullTimeFormat = localeData.fullTimeFormat.replace('v', 'z');
- }
- if (localeData.numberPattern != null) {
- // The number pattern might contain positive and negative subpatterns. Arabic, for
- // example, might look like "#,##0.###;#,##0.###-" because the minus sign should be
- // written last. Macedonian supposedly looks something like "#,##0.###;(#,##0.###)".
- // (The negative subpattern is optional, though, and not present in most locales.)
- // By only swallowing '#'es and ','s after the '.', we ensure that we don't
- // accidentally eat too much.
- localeData.integerPattern = localeData.numberPattern.replaceAll("\\.[#,]*", "");
- }
- return localeData;
- }
-
- private static native boolean initLocaleDataImpl(String locale, LocaleData result);
+ static native boolean initLocaleDataImpl(String locale, LocaleData result);
}
diff --git a/icu/src/main/java/com/ibm/icu4jni/util/LocaleData.java b/icu/src/main/java/com/ibm/icu4jni/util/LocaleData.java
index 0ba18d1..e27bd54 100644
--- a/icu/src/main/java/com/ibm/icu4jni/util/LocaleData.java
+++ b/icu/src/main/java/com/ibm/icu4jni/util/LocaleData.java
@@ -18,6 +18,8 @@ package com.ibm.icu4jni.util;
import java.text.DateFormat;
import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Locale;
/**
* Passes locale-specific from ICU native code to Java.
@@ -27,29 +29,32 @@ import java.util.Arrays;
* them a clone rather than the original.
*/
public final class LocaleData {
+ // A cache for the locale-specific data.
+ private static final HashMap<String, LocaleData> localeDataCache = new HashMap<String, LocaleData>();
+
public Integer firstDayOfWeek;
public Integer minimalDaysInFirstWeek;
-
+
public String[] amPm;
-
+
public String[] eras;
-
+
public String[] longMonthNames;
public String[] shortMonthNames;
-
+
public String[] longWeekdayNames;
public String[] shortWeekdayNames;
-
+
public String fullTimeFormat;
public String longTimeFormat;
public String mediumTimeFormat;
public String shortTimeFormat;
-
+
public String fullDateFormat;
public String longDateFormat;
public String mediumDateFormat;
public String shortDateFormat;
-
+
// DecimalFormatSymbols.
public char zeroDigit;
public char digit;
@@ -63,15 +68,61 @@ public final class LocaleData {
public String exponentSeparator;
public String infinity;
public String NaN;
-
+
public String currencySymbol;
public String internationalCurrencySymbol;
-
+
public String numberPattern;
public String integerPattern;
public String currencyPattern;
public String percentPattern;
-
+
+ private LocaleData() {
+ }
+
+ /**
+ * Returns a shared LocaleData for the given locale.
+ */
+ public static LocaleData get(Locale locale) {
+ if (locale == null) {
+ locale = Locale.getDefault();
+ }
+ String localeName = locale.toString();
+ synchronized (localeDataCache) {
+ LocaleData localeData = localeDataCache.get(localeName);
+ if (localeData != null) {
+ return localeData;
+ }
+ }
+ LocaleData newLocaleData = makeLocaleData(locale);
+ synchronized (localeDataCache) {
+ LocaleData localeData = localeDataCache.get(localeName);
+ if (localeData != null) {
+ return localeData;
+ }
+ localeDataCache.put(localeName, newLocaleData);
+ return newLocaleData;
+ }
+ }
+
+ private static LocaleData makeLocaleData(Locale locale) {
+ String language = locale.getLanguage();
+ String country = locale.getCountry();
+ String variant = locale.getVariant();
+ // Start with data from the parent (next-most-specific) locale...
+ LocaleData result = new LocaleData();
+ if (!variant.isEmpty()) {
+ result.overrideWithDataFrom(get(new Locale(language, country, "")));
+ } else if (!country.isEmpty()) {
+ result.overrideWithDataFrom(get(new Locale(language, "", "")));
+ } else if (!language.isEmpty()) {
+ result.overrideWithDataFrom(get(Locale.ROOT));
+ }
+ // Override with data from this locale.
+ result.overrideWithDataFrom(initLocaleData(locale));
+ return result;
+ }
+
@Override public String toString() {
return "LocaleData[" +
"firstDayOfWeek=" + firstDayOfWeek + "," +
@@ -109,8 +160,8 @@ public final class LocaleData {
"currencyPattern=" + currencyPattern + "," +
"percentPattern=" + percentPattern + "]";
}
-
- public void overrideWithDataFrom(LocaleData overrides) {
+
+ private void overrideWithDataFrom(LocaleData overrides) {
if (overrides.firstDayOfWeek != null) {
firstDayOfWeek = overrides.firstDayOfWeek;
}
@@ -214,7 +265,7 @@ public final class LocaleData {
percentPattern = overrides.percentPattern;
}
}
-
+
public String getDateFormat(int style) {
switch (style) {
case DateFormat.SHORT:
@@ -228,7 +279,7 @@ public final class LocaleData {
}
throw new AssertionError();
}
-
+
public String getTimeFormat(int style) {
switch (style) {
case DateFormat.SHORT:
@@ -242,4 +293,29 @@ public final class LocaleData {
}
throw new AssertionError();
}
+
+ private static LocaleData initLocaleData(Locale locale) {
+ LocaleData localeData = new LocaleData();
+ if (!ICU.initLocaleDataImpl(locale.toString(), localeData)) {
+ throw new AssertionError("couldn't initialize LocaleData for locale " + locale);
+ }
+ if (localeData.fullTimeFormat != null) {
+ // There are some full time format patterns in ICU that use the pattern character 'v'.
+ // Java doesn't accept this, so we replace it with 'z' which has about the same result
+ // as 'v', the timezone name.
+ // 'v' -> "PT", 'z' -> "PST", v is the generic timezone and z the standard tz
+ // "vvvv" -> "Pacific Time", "zzzz" -> "Pacific Standard Time"
+ localeData.fullTimeFormat = localeData.fullTimeFormat.replace('v', 'z');
+ }
+ if (localeData.numberPattern != null) {
+ // The number pattern might contain positive and negative subpatterns. Arabic, for
+ // example, might look like "#,##0.###;#,##0.###-" because the minus sign should be
+ // written last. Macedonian supposedly looks something like "#,##0.###;(#,##0.###)".
+ // (The negative subpattern is optional, though, and not present in most locales.)
+ // By only swallowing '#'es and ','s after the '.', we ensure that we don't
+ // accidentally eat too much.
+ localeData.integerPattern = localeData.numberPattern.replaceAll("\\.[#,]*", "");
+ }
+ return localeData;
+ }
}
diff --git a/icu/src/main/native/BidiWrapper.cpp b/icu/src/main/native/BidiWrapper.cpp
index 68419c0..7a25ff1 100644
--- a/icu/src/main/native/BidiWrapper.cpp
+++ b/icu/src/main/native/BidiWrapper.cpp
@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#define LOG_TAG "BidiWrapper"
#include "AndroidSystemNatives.h"
#include <JNIHelp.h>
#include "ErrorCode.h"
diff --git a/icu/src/main/native/Resources.cpp b/icu/src/main/native/ICU.cpp
index fb53f87..3066edb 100644
--- a/icu/src/main/native/Resources.cpp
+++ b/icu/src/main/native/ICU.cpp
@@ -14,10 +14,11 @@
* limitations under the License.
*/
-#define LOG_TAG "Resources"
+#define LOG_TAG "ICU"
#include "JNIHelp.h"
#include "AndroidSystemNatives.h"
#include "ScopedUtfChars.h"
+#include "UniquePtr.h"
#include "cutils/log.h"
#include "unicode/numfmt.h"
#include "unicode/locid.h"
@@ -72,28 +73,23 @@ static Locale getLocale(JNIEnv* env, jstring localeName) {
return Locale::createFromName(ScopedUtfChars(env, localeName).data());
}
-static jint getCurrencyFractionDigitsNative(JNIEnv* env, jclass clazz, jstring currencyCode) {
+static jint getCurrencyFractionDigitsNative(JNIEnv* env, jclass, jstring currencyCode) {
UErrorCode status = U_ZERO_ERROR;
-
- NumberFormat* fmt = NumberFormat::createCurrencyInstance(status);
+ UniquePtr<NumberFormat> fmt(NumberFormat::createCurrencyInstance(status));
if (U_FAILURE(status)) {
return -1;
}
-
const jchar* cCode = env->GetStringChars(currencyCode, NULL);
fmt->setCurrency(cCode, status);
env->ReleaseStringChars(currencyCode, cCode);
if (U_FAILURE(status)) {
return -1;
}
-
// for CurrencyFormats the minimum and maximum fraction digits are the same.
- int result = fmt->getMinimumFractionDigits();
- delete fmt;
- return result;
+ return fmt->getMinimumFractionDigits();
}
-static jstring getCurrencyCodeNative(JNIEnv* env, jclass clazz, jstring key) {
+static jstring getCurrencyCodeNative(JNIEnv* env, jclass, jstring key) {
UErrorCode status = U_ZERO_ERROR;
ScopedResourceBundle supplData(ures_openDirect(NULL, "supplementalData", &status));
if (U_FAILURE(status)) {
@@ -142,8 +138,7 @@ static jstring getCurrencyCodeNative(JNIEnv* env, jclass clazz, jstring key) {
return env->NewString(id, length);
}
-static jstring getCurrencySymbolNative(JNIEnv* env, jclass clazz,
- jstring locale, jstring currencyCode) {
+static jstring getCurrencySymbolNative(JNIEnv* env, jclass, jstring locale, jstring currencyCode) {
// LOGI("ENTER getCurrencySymbolNative");
const char* locName = env->GetStringUTFChars(locale, NULL);
@@ -175,8 +170,7 @@ static jstring getCurrencySymbolNative(JNIEnv* env, jclass clazz,
return (currSymbL == 0) ? NULL : env->NewString(currSymbU, currSymbL);
}
-static jstring getDisplayCountryNative(JNIEnv* env, jclass clazz,
- jstring targetLocale, jstring locale) {
+static jstring getDisplayCountryNative(JNIEnv* env, jclass, jstring targetLocale, jstring locale) {
Locale loc = getLocale(env, locale);
Locale targetLoc = getLocale(env, targetLocale);
@@ -186,8 +180,7 @@ static jstring getDisplayCountryNative(JNIEnv* env, jclass clazz,
return env->NewString(str.getBuffer(), str.length());
}
-static jstring getDisplayLanguageNative(JNIEnv* env, jclass clazz,
- jstring targetLocale, jstring locale) {
+static jstring getDisplayLanguageNative(JNIEnv* env, jclass, jstring targetLocale, jstring locale) {
Locale loc = getLocale(env, locale);
Locale targetLoc = getLocale(env, targetLocale);
@@ -197,23 +190,20 @@ static jstring getDisplayLanguageNative(JNIEnv* env, jclass clazz,
return env->NewString(str.getBuffer(), str.length());
}
-static jstring getDisplayVariantNative(JNIEnv* env, jclass clazz,
- jstring targetLocale, jstring locale) {
-
+static jstring getDisplayVariantNative(JNIEnv* env, jclass, jstring targetLocale, jstring locale) {
Locale loc = getLocale(env, locale);
Locale targetLoc = getLocale(env, targetLocale);
-
UnicodeString str;
targetLoc.getDisplayVariant(loc, str);
return env->NewString(str.getBuffer(), str.length());
}
-static jstring getISO3CountryNative(JNIEnv* env, jclass clazz, jstring locale) {
+static jstring getISO3CountryNative(JNIEnv* env, jclass, jstring locale) {
Locale loc = getLocale(env, locale);
return env->NewStringUTF(loc.getISO3Country());
}
-static jstring getISO3LanguageNative(JNIEnv* env, jclass clazz, jstring locale) {
+static jstring getISO3LanguageNative(JNIEnv* env, jclass, jstring locale) {
Locale loc = getLocale(env, locale);
return env->NewStringUTF(loc.getISO3Language());
}
@@ -232,11 +222,11 @@ static jobjectArray toStringArray(JNIEnv* env, const char* const* strings) {
return result;
}
-static jobjectArray getISOCountriesNative(JNIEnv* env, jclass clazz) {
+static jobjectArray getISOCountriesNative(JNIEnv* env, jclass) {
return toStringArray(env, Locale::getISOCountries());
}
-static jobjectArray getISOLanguagesNative(JNIEnv* env, jclass clazz) {
+static jobjectArray getISOLanguagesNative(JNIEnv* env, jclass) {
return toStringArray(env, Locale::getISOLanguages());
}
@@ -289,9 +279,7 @@ static jstring formatDate(JNIEnv* env, const SimpleDateFormat& fmt, const UDate&
return env->NewString(str.getBuffer(), str.length());
}
-static void getTimeZonesNative(JNIEnv* env, jclass clazz,
- jobjectArray outerArray, jstring locale) {
-
+static void getTimeZonesNative(JNIEnv* env, jclass, jobjectArray outerArray, jstring locale) {
// get all timezone objects
jobjectArray zoneIdArray = (jobjectArray) env->GetObjectArrayElement(outerArray, 0);
int count = env->GetArrayLength(zoneIdArray);
@@ -361,18 +349,13 @@ static void getTimeZonesNative(JNIEnv* env, jclass clazz,
}
}
-static jstring getDisplayTimeZoneNative(JNIEnv* env, jclass clazz,
- jstring zoneId, jboolean isDST, jint style, jstring localeId) {
-
- TimeZone* zone = timeZoneFromId(env, zoneId);
+static jstring getDisplayTimeZoneNative(JNIEnv* env, jclass, jstring zoneId, jboolean isDST, jint style, jstring localeId) {
+ UniquePtr<TimeZone> zone(timeZoneFromId(env, zoneId));
Locale locale = getLocale(env, localeId);
-
// Try to get the display name of the TimeZone according to the Locale
UnicodeString displayName;
zone->getDisplayName((UBool)isDST, (style == 0 ? TimeZone::SHORT : TimeZone::LONG), locale, displayName);
- jstring result = env->NewString(displayName.getBuffer(), displayName.length());
- delete zone;
- return result;
+ return env->NewString(displayName.getBuffer(), displayName.length());
}
static bool getDayIntVector(JNIEnv* env, UResourceBundle* gregorian, int* values) {
@@ -604,7 +587,7 @@ static void setCharField(JNIEnv* env, jobject obj, const char* fieldName, UResou
}
}
-static jboolean initLocaleDataImpl(JNIEnv* env, jclass clazz, jstring locale, jobject localeData) {
+static jboolean initLocaleDataImpl(JNIEnv* env, jclass, jstring locale, jobject localeData) {
const char* loc = env->GetStringUTFChars(locale, NULL);
UErrorCode status = U_ZERO_ERROR;
ScopedResourceBundle root(ures_openU(NULL, loc, &status));
@@ -674,7 +657,7 @@ static jboolean initLocaleDataImpl(JNIEnv* env, jclass clazz, jstring locale, jo
jstring internationalCurrencySymbol = getIntCurrencyCode(env, locale);
jstring currencySymbol = NULL;
if (internationalCurrencySymbol != NULL) {
- currencySymbol = getCurrencySymbolNative(env, clazz, locale, internationalCurrencySymbol);
+ currencySymbol = getCurrencySymbolNative(env, NULL, locale, internationalCurrencySymbol);
} else {
internationalCurrencySymbol = env->NewStringUTF("XXX");
}
@@ -725,6 +708,5 @@ int register_com_ibm_icu4jni_util_Resources(JNIEnv* env) {
}
string_class = (jclass) env->NewGlobalRef(stringclass);
- return jniRegisterNativeMethods(env, "com/ibm/icu4jni/util/Resources",
- gMethods, NELEM(gMethods));
+ return jniRegisterNativeMethods(env, "com/ibm/icu4jni/util/ICU", gMethods, NELEM(gMethods));
}
diff --git a/icu/src/main/native/NativeBreakIterator.cpp b/icu/src/main/native/NativeBreakIterator.cpp
index 6cc774b..5b12ba3 100644
--- a/icu/src/main/native/NativeBreakIterator.cpp
+++ b/icu/src/main/native/NativeBreakIterator.cpp
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#define LOG_TAG "NativeBreakIterator"
+
#include "JNIHelp.h"
#include "AndroidSystemNatives.h"
#include "ErrorCode.h"
diff --git a/icu/src/main/native/NativeCollation.cpp b/icu/src/main/native/NativeCollation.cpp
index 148c16e..5bc7749 100644
--- a/icu/src/main/native/NativeCollation.cpp
+++ b/icu/src/main/native/NativeCollation.cpp
@@ -7,6 +7,8 @@
*******************************************************************************
*/
+#define LOG_TAG "NativeCollation"
+
#include "JNIHelp.h"
#include "AndroidSystemNatives.h"
#include "ErrorCode.h"
diff --git a/icu/src/main/native/NativeConverter.cpp b/icu/src/main/native/NativeConverter.cpp
index 1bb9ac8..f227f3d 100644
--- a/icu/src/main/native/NativeConverter.cpp
+++ b/icu/src/main/native/NativeConverter.cpp
@@ -15,6 +15,8 @@
* @author: Ram Viswanadha
*/
+#define LOG_TAG "NativeConverter"
+
#include "AndroidSystemNatives.h"
#include "ErrorCode.h"
#include "JNIHelp.h"
diff --git a/icu/src/main/native/NativeDecimalFormat.cpp b/icu/src/main/native/NativeDecimalFormat.cpp
index b62e5b1..6909553 100644
--- a/icu/src/main/native/NativeDecimalFormat.cpp
+++ b/icu/src/main/native/NativeDecimalFormat.cpp
@@ -15,6 +15,7 @@
*/
#define LOG_TAG "NativeDecimalFormat"
+
#include "JNIHelp.h"
#include "AndroidSystemNatives.h"
#include "cutils/log.h"
diff --git a/icu/src/main/native/NativeIDN.cpp b/icu/src/main/native/NativeIDN.cpp
index 72afc74..2b45dbe 100644
--- a/icu/src/main/native/NativeIDN.cpp
+++ b/icu/src/main/native/NativeIDN.cpp
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#define LOG_TAG "NativeIDN"
+
#include "ErrorCode.h"
#include "JNIHelp.h"
#include "ScopedJavaUnicodeString.h"
diff --git a/icu/src/main/native/NativeNormalizer.cpp b/icu/src/main/native/NativeNormalizer.cpp
index 0aa7d29..663a7c1 100644
--- a/icu/src/main/native/NativeNormalizer.cpp
+++ b/icu/src/main/native/NativeNormalizer.cpp
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#define LOG_TAG "NativeNormalizer"
+
#include "ErrorCode.h"
#include "JNIHelp.h"
#include "ScopedJavaUnicodeString.h"
diff --git a/icu/src/main/native/NativeRegEx.cpp b/icu/src/main/native/NativeRegEx.cpp
index 7b3cafc..f8be4ee 100644
--- a/icu/src/main/native/NativeRegEx.cpp
+++ b/icu/src/main/native/NativeRegEx.cpp
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#define LOG_TAG "NativeRegEx"
+
#include "AndroidSystemNatives.h"
#include <stdlib.h>
diff --git a/icu/src/main/native/UCharacter.cpp b/icu/src/main/native/UCharacter.cpp
index 9856a1a..4186b75 100644
--- a/icu/src/main/native/UCharacter.cpp
+++ b/icu/src/main/native/UCharacter.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#define LOG_TAG "UCharacter"
#include "JNIHelp.h"
#include "AndroidSystemNatives.h"
#include "ScopedJavaUnicodeString.h"
diff --git a/icu/src/main/native/sub.mk b/icu/src/main/native/sub.mk
index f72db1b..599c102 100644
--- a/icu/src/main/native/sub.mk
+++ b/icu/src/main/native/sub.mk
@@ -5,6 +5,7 @@
LOCAL_SRC_FILES := \
BidiWrapper.cpp \
ErrorCode.cpp \
+ ICU.cpp \
NativeBreakIterator.cpp \
NativeCollation.cpp \
NativeConverter.cpp \
@@ -12,7 +13,6 @@ LOCAL_SRC_FILES := \
NativeIDN.cpp \
NativeNormalizer.cpp \
NativeRegEx.cpp \
- Resources.cpp \
UCharacter.cpp
LOCAL_C_INCLUDES += \