Simplified redundant code and removed unnecessary code path for Java 7 and later runtime in various places. Also cleaned up stale comments.
There is one test code change in com.ibm.icu.dev.test.localespi.NumberFormatTest - number keyword in test case was changed to Arab to arab. This test case was skipped with Java 6 runtime. It looks this code was note tested on Java 7 and later. @number=Arab does not work because it's case sensitive and must be all lower case letters.
//private final static boolean debug = ICUDebug.enabled("UConverterDataReader");
private static final class IsAcceptable implements ICUBinary.Authenticate {
- // @Override when we switch to Java 6
@Override
public boolean isDataVersionAcceptable(byte formatVersion[]) {
return formatVersion[0] == 6;
if(codesLength == codesAndRanges.length) {
codes = codesAndRanges;
} else {
- // TODO: Java 6: Arrays.copyOf(codes, codesLength);
- codes = new int[codesLength];
- System.arraycopy(codesAndRanges, 0, codes, 0, codesLength);
+ codes = Arrays.copyOf(codesAndRanges, codesLength);
}
int rangesStart = codesLength;
int rangesLimit = codesAndRanges.length;
assert (valid == null) == (actual == null);
// Another check we could do is that the actual locale is at
// the same level or less specific than the valid locale.
- // TODO: Starting with Java 7, use Objects.equals(a, b).
if(Objects.equals(actual, tailoring.actualLocale)) {
actualLocaleIsSameAsValid = false;
} else {
import java.nio.ByteOrder;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.MissingResourceException;
import java.util.Set;
}
}
- private static final List<DataFile> icuDataFiles = new ArrayList<DataFile>();
+ private static final List<DataFile> icuDataFiles = new ArrayList<>();
static {
// Normally com.ibm.icu.impl.ICUBinary.dataPath.
} else if (capacity < 0x4000) {
capacity *= 2; // Grow faster until we reach 16kB.
}
- // TODO Java 6 replace new byte[] and arraycopy(): bytes = Arrays.copyOf(bytes, capacity);
- byte[] newBytes = new byte[capacity];
- System.arraycopy(bytes, 0, newBytes, 0, length);
- bytes = newBytes;
+ bytes = Arrays.copyOf(bytes, capacity);
bytes[length++] = (byte) nextByte;
}
}
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.IntBuffer;
+import java.util.Arrays;
import com.ibm.icu.util.ICUException;
import com.ibm.icu.util.ICUUncheckedIOException;
return value;
}
values[index] = CacheValue.futureInstancesWillBeStrong() ?
- item : new SoftReference<Object>(item);
+ item : new SoftReference<>(item);
return item;
}
return level.putIfAbsent(key, item, size);
}
keys[index] = key;
- values[index] = storeDirectly(size) ? item : new SoftReference<Object>(item);
+ values[index] = storeDirectly(size) ? item : new SoftReference<>(item);
return item;
}
// Collision: Add a child level, move the old item there,
}
private int findSimple(int key) {
- // With Java 6, return Arrays.binarySearch(keys, 0, length, key).
- int start = 0;
- int limit = length;
- while((limit - start) > 8) {
- int mid = (start + limit) / 2;
- if(key < keys[mid]) {
- limit = mid;
- } else {
- start = mid;
- }
- }
- // For a small number of items, linear search should be a little faster.
- while(start < limit) {
- int k = keys[start];
- if(key < k) {
- return ~start;
- }
- if(key == k) {
- return start;
- }
- ++start;
- }
- return ~start;
+ return Arrays.binarySearch(keys, 0, length, key);
}
@SuppressWarnings("unchecked")
}
++length;
keys[index] = res;
- values[index] = storeDirectly(size) ? item : new SoftReference<Object>(item);
+ values[index] = storeDirectly(size) ? item : new SoftReference<>(item);
return item;
} else /* not found && length == SIMPLE_LENGTH */ {
// Grow to become trie-like.
import java.io.IOException;
import java.io.ObjectInputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.util.Date;
import java.util.TreeSet;
private java.util.TimeZone javatz;
private transient java.util.Calendar javacal;
- private static Method mObservesDaylightTime;
static {
- AVAILABLESET = new TreeSet<String>();
+ AVAILABLESET = new TreeSet<>();
String[] availableIds = java.util.TimeZone.getAvailableIDs();
for (int i = 0; i < availableIds.length; i++) {
AVAILABLESET.add(availableIds[i]);
}
-
- try {
- mObservesDaylightTime = java.util.TimeZone.class.getMethod("observesDaylightTime", (Class[]) null);
- } catch (NoSuchMethodException e) {
- // Java 6 or older
- } catch (SecurityException e) {
- // not visible
- }
}
/**
*/
@Override
public boolean observesDaylightTime() {
- if (mObservesDaylightTime != null) {
- // Java 7+
- try {
- return (Boolean)mObservesDaylightTime.invoke(javatz, (Object[]) null);
- } catch (IllegalAccessException e) {
- } catch (IllegalArgumentException e) {
- } catch (InvocationTargetException e) {
- }
- }
- return super.observesDaylightTime();
+ return javatz.observesDaylightTime();
}
/* (non-Javadoc)
}
private static final class IsAcceptable implements ICUBinary.Authenticate {
- // @Override when we switch to Java 6
@Override
public boolean isDataVersionAcceptable(byte version[]) {
return version[0] == 7;
private String nameGroups;
private static final class IsAcceptable implements ICUBinary.Authenticate {
- // @Override when we switch to Java 6
@Override
public boolean isDataVersionAcceptable(byte version[]) {
return version[0]==2;
// Cache to save currency name trie
private static ICUCache<ULocale, List<TextTrieMap<CurrencyStringInfo>>> CURRENCY_NAME_CACHE =
- new SimpleCache<ULocale, List<TextTrieMap<CurrencyStringInfo>>>();
+ new SimpleCache<>();
/**
* Selector for getName() indicating a symbolic name for a
public static Set<Currency> getAvailableCurrencies() {
CurrencyMetaInfo info = CurrencyMetaInfo.getInstance();
List<String> list = info.currencies(CurrencyFilter.all());
- HashSet<Currency> resultSet = new HashSet<Currency>(list.size());
+ HashSet<Currency> resultSet = new HashSet<>(list.size());
for (String code : list) {
resultSet.add(getInstance(code));
}
* @see #getName(Locale, int, boolean[])
* @stable ICU 49
*/
- @SuppressWarnings("javadoc") // java.util.Currency#getDisplayName() is introduced in Java 7
public String getDisplayName() {
return getName(Locale.getDefault(), LONG_NAME, null);
}
* @see #getName(Locale, int, boolean[])
* @stable ICU 49
*/
- @SuppressWarnings("javadoc") // java.util.Currency#getDisplayName() is introduced in Java 7
public String getDisplayName(Locale locale) {
return getName(locale, LONG_NAME, null);
}
List<TextTrieMap<CurrencyStringInfo>> currencyTrieVec = CURRENCY_NAME_CACHE.get(locale);
if (currencyTrieVec == null) {
TextTrieMap<CurrencyStringInfo> currencyNameTrie =
- new TextTrieMap<CurrencyStringInfo>(true);
+ new TextTrieMap<>(true);
TextTrieMap<CurrencyStringInfo> currencySymbolTrie =
- new TextTrieMap<CurrencyStringInfo>(false);
- currencyTrieVec = new ArrayList<TextTrieMap<CurrencyStringInfo>>();
+ new TextTrieMap<>(false);
+ currencyTrieVec = new ArrayList<>();
currencyTrieVec.add(currencySymbolTrie);
currencyTrieVec.add(currencyNameTrie);
setupCurrencyTrieVec(locale, currencyTrieVec);
//CurrencyFilter filter = CurrencyFilter.onDateRange(null, new Date(253373299200000L));
CurrencyFilter filter = CurrencyFilter.all();
all = Collections.unmodifiableList(getTenderCurrencies(filter));
- ALL_TENDER_CODES = new SoftReference<List<String>>(all);
+ ALL_TENDER_CODES = new SoftReference<>(all);
}
return all;
}
if (all == null) {
CurrencyMetaInfo info = CurrencyMetaInfo.getInstance();
all = Collections.unmodifiableSet(
- new HashSet<String>(info.currencies(CurrencyFilter.all())));
- ALL_CODES_AS_SET = new SoftReference<Set<String>>(all);
+ new HashSet<>(info.currencies(CurrencyFilter.all())));
+ ALL_CODES_AS_SET = new SoftReference<>(all);
}
return all;
}
// Generic format
TimeZoneFormat tzfmt = TimeZoneFormat.getInstance(locale);
long date = System.currentTimeMillis();
- Output<TimeType> timeType = new Output<TimeType>(TimeType.UNKNOWN);
+ Output<TimeType> timeType = new Output<>(TimeType.UNKNOWN);
switch (style) {
case GENERIC_LOCATION:
* @see #useDaylightTime
* @stable ICU 49
*/
- @SuppressWarnings("javadoc") // java.util.TimeZone#observesDaylightTime() is introduced in Java 7
public boolean observesDaylightTime() {
return useDaylightTime() || inDaylightTime(new Date());
}
*/
package com.ibm.icu.impl.icuadapter;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
private TimeZone fJdkTz;
private transient Calendar fJdkCal;
- private static Method mObservesDaylightTime;
-
- static {
- try {
- mObservesDaylightTime = TimeZone.class.getMethod("observesDaylightTime", (Class[]) null);
- } catch (NoSuchMethodException e) {
- // Java 6 or older
- } catch (SecurityException e) {
- // not visible
- }
- }
private TimeZoneJDK(TimeZone jdkTz) {
fJdkTz = (TimeZone)jdkTz.clone();
}
-
+
public static com.ibm.icu.util.TimeZone wrap(TimeZone jdkTz) {
if (jdkTz instanceof TimeZoneICU) {
return ((TimeZoneICU)jdkTz).unwrap();
}
return new TimeZoneJDK(jdkTz);
}
-
+
public TimeZone unwrap() {
return (TimeZone)fJdkTz.clone();
}
public String getDisplayName(boolean daylight, int style, Locale locale) {
return fJdkTz.getDisplayName(daylight, style, locale);
}
-
+
@Override
public String getDisplayName(boolean daylight, int style, ULocale locale) {
return fJdkTz.getDisplayName(daylight, style, locale.toLocale());
@Override
public boolean observesDaylightTime() {
- if (mObservesDaylightTime != null) {
- // Java 7+
- try {
- return (Boolean)mObservesDaylightTime.invoke(fJdkTz, (Object[]) null);
- } catch (IllegalAccessException e) {
- } catch (IllegalArgumentException e) {
- } catch (InvocationTargetException e) {
- }
- }
- return super.observesDaylightTime();
+ return fJdkTz.observesDaylightTime();
}
// Freezable stuffs
return ULocale.forLocale(spLoc);
}
- // The locale may have script field on Java 7+.
+ // The locale may have script field.
// So we once convert it to ULocale, then strip the ICU suffix off
// if necessary.
ULocale result = ULocale.forLocale(locale);
return SPECIAL_LOCALES_MAP;
}
- Map<Locale, Locale> splocs = new HashMap<Locale, Locale>();
+ Map<Locale, Locale> splocs = new HashMap<>();
for (Locale spLoc : SPECIAL_LOCALES) {
String var = spLoc.getVariant();
if (var.length() > 0) {
return LOCALES;
}
- Set<Locale> localeSet = new HashSet<Locale>();
+ Set<Locale> localeSet = new HashSet<>();
ULocale[] icuLocales = ICUResourceBundle.getAvailableULocales();
for (ULocale uloc : icuLocales) {
}
private static void addULocale(ULocale uloc, Set<Locale> locales) {
- // special case - nn
- // ULocale#toLocale on Java 6 maps "nn" to "no_NO_NY"
- if (uloc.getLanguage().equals("nn") && uloc.getScript().length() == 0) {
- Locale locNN = new Locale(uloc.getLanguage(), uloc.getCountry(), uloc.getVariant());
- addLocale(locNN, locales);
- return;
- }
-
locales.add(uloc.toLocale());
if (enableIcuVariants()) {
return sym;
}
- // Not available in Java 6
- // @Override
+ @Override
public String getDisplayName(String currencyCode, Locale locale) {
CurrencyDisplayNames curDispNames = CurrencyDisplayNames.getInstance(ICULocaleServiceProvider.toULocaleNoSpecialVariant(locale));
String name = curDispNames.getName(currencyCode);
return disp;
}
- // Not available in Java 6
- // @Override
+ @Override
public String getDisplayScript(String scriptCode, Locale locale) {
scriptCode = AsciiUtil.toTitleString(scriptCode);
String disp = LocaleDisplayNames.getInstance(ICULocaleServiceProvider.toULocaleNoSpecialVariant(locale))
<target name="@compile">
<echo message="build-local: ${global.build-local.properties}"/>
- <!-- set java 6 bootclasspath to empty if not set -->
+ <!-- set java 7 bootclasspath to empty if not set -->
<property name="java7.bootclasspath" value=""/>
<condition property="javac.bootclasspath" value="${java7.bootclasspath}" else="">
import org.junit.runners.JUnit4;
import com.ibm.icu.dev.test.TestFmwk;
-import com.ibm.icu.dev.test.TestUtil;
-import com.ibm.icu.dev.test.TestUtil.JavaVendor;
import com.ibm.icu.text.DateFormat;
import com.ibm.icu.text.NumberFormat;
import com.ibm.icu.util.Calendar;
long count = locales.length;
logln("Got " + count + " locales" );
- // Ticket #6280, #8078 and #11674
- // These locales should be included in the result
- boolean missingLocaleNotFatal =
- TestUtil.getJavaVendor() == JavaVendor.Android || TestUtil.getJavaVersion() >= 7;
+ // These test cases used to check Locales without a script tag.
+ // Java 6 Locale did not support script tags, such as zh_CN and zh_TW.
+ // Because ICU 63+ supports Java 7 as minimum Java version, sample
+ // Locales below were updated with ones with script tags.
+ // See ticket #6280, #8078 and #11674 for the history.
final Locale[] samples = {
- new Locale("zh", "CN"),
- new Locale("zh", "TW"),
- new Locale("zh", "HK"),
- new Locale("sr", "RS"),
+ Locale.forLanguageTag("zh-Hans-CN"),
+ Locale.forLanguageTag("zh-Hant-TW"),
+ Locale.forLanguageTag("zh-Hant-HK"),
+ Locale.forLanguageTag("sr-Cyrl-RS"),
};
boolean[] available = new boolean[samples.length];
for(int i = 0; i < count; i++) {
}
for (int i = 0; i < available.length; i++) {
if (!available[i]) {
- if (missingLocaleNotFatal) {
- // Java 7 supports script field, so zh_Hans_CN is included
- // in the available locale list.
- logln("INFO: missing Locale: " + samples[i]);
- } else {
- errln("ERROR: missing Locale: " + samples[i]);
- }
+ errln("ERROR: missing Locale: " + samples[i]);
}
}
UnicodeSet scriptSet = new UnicodeSet();
scriptSet.applyIntPropertyValue(UProperty.SCRIPT, sc);
if(usage == ScriptUsage.NOT_ENCODED) {
- assertTrue(sn + " not encoded, no sample", sample.length() == 0); // Java 6: sample.isEmpty()
+ assertTrue(sn + " not encoded, no sample", sample.isEmpty());
assertFalse(sn + " not encoded, not RTL", UScript.isRightToLeft(sc));
assertFalse(sn + " not encoded, not LB letters", UScript.breaksBetweenLetters(sc));
assertFalse(sn + " not encoded, not cased", UScript.isCased(sc));
assertTrue(sn + " not encoded, no characters", scriptSet.isEmpty());
} else {
- assertFalse(sn + " encoded, has a sample character", sample.length() == 0); // Java 6: sample.isEmpty()
+ assertFalse(sn + " encoded, has a sample character", sample.isEmpty());
int firstChar = sample.codePointAt(0);
int charScript = getCharScript(sc);
assertEquals(sn + " script(sample(script))",
static class BreakRules {
BreakRules(RBBIMonkeyImpl monkeyImpl) {
fMonkeyImpl = monkeyImpl;
- fBreakRules = new ArrayList<BreakRule>();
+ fBreakRules = new ArrayList<>();
fType = BreakIterator.KIND_TITLE;
- fCharClasses = new HashMap<String, CharClass>();
- fCharClassList = new ArrayList<CharClass>();
+ fCharClasses = new HashMap<>();
+ fCharClassList = new ArrayList<>();
fDictionarySet = new UnicodeSet();
// Match an alpha-numeric identifier in a rule. Will be a set name.
thisRule.fExpandedRule = thisRule.fExpandedRule.replace("[]", "[a&&[^a]]");
- // Change Unicode escape syntax for compatibility with Java regular expressions (Java 7 or newer)
+ // Change Unicode escape syntax for compatibility with Java regular expressions
// \udddd => \x{dddd}
// \U00hhhhhh => \x{hhhhhh}
- // thisRule.fExpandedRule = thisRule.fExpandedRule.replaceAll("\\\\u([0-9A-Fa-f]{4})", "\\\\x{$1}");
- // thisRule.fExpandedRule = thisRule.fExpandedRule.replaceAll("\\\\U00([0-9A-Fa-f]{6})", "\\\\x{$1}");
-
- // Java 6 compatibility troubles - there is no syntax for escaping a supplementary character
- // within a regular expression character class. Put them in as unescaped literal chars.
- StringBuilder sb = new StringBuilder(thisRule.fExpandedRule);
- while (true) {
- int where = sb.indexOf("\\U00");
- if (where < 0) {
- break;
- }
- String cp = hexToCodePoint(sb.substring(where+2, where+10));
- sb.replace(where, where+10, cp);
- }
- thisRule.fExpandedRule = sb.toString();
+ thisRule.fExpandedRule = thisRule.fExpandedRule.replaceAll("\\\\u([0-9A-Fa-f]{4})", "\\\\x{$1}");
+ thisRule.fExpandedRule = thisRule.fExpandedRule.replaceAll("\\\\U00([0-9A-Fa-f]{6})", "\\\\x{$1}");
// Escape any literal '#' in the rule expression. Without escaping, these introduce a comment.
// UnicodeSet._generatePattern() inserts un-escaped "#"s
boolean verbose = getBooleanProperty("verbose", false);
int seed = getIntProperty("seed", 1);
- List<RBBIMonkeyImpl> startedTests = new ArrayList<RBBIMonkeyImpl>();
+ List<RBBIMonkeyImpl> startedTests = new ArrayList<>();
// Monkey testing is multi-threaded.
// Each set of break rules to be tested is run in a separate thread.
import org.junit.runners.JUnit4;
import com.ibm.icu.dev.test.TestFmwk;
-import com.ibm.icu.dev.test.TestUtil;
-import com.ibm.icu.dev.test.TestUtil.JavaVendor;
import com.ibm.icu.impl.CurrencyData;
import com.ibm.icu.text.CurrencyDisplayNames;
import com.ibm.icu.text.CurrencyMetaInfo;
String[] actual = Currency.getAvailableCurrencyCodes(locale, date);
// Order is not important as of 4.4. We never documented that it was.
- Set<String> expectedSet = new HashSet<String>();
+ Set<String> expectedSet = new HashSet<>();
if (expected != null) {
expectedSet.addAll(Arrays.asList(expected));
}
- Set<String> actualSet = new HashSet<String>();
+ Set<String> actualSet = new HashSet<>();
if (actual != null) {
actualSet.addAll(Arrays.asList(actual));
}
assertEquals(locale + " on " + timeString, expectedSet, actualSet);
// With Java Locale
- // Note: skip this test on Java 6 or older when keywords are available
- if (locale.getKeywords() == null || TestUtil.getJavaVendor() == JavaVendor.Android || TestUtil.getJavaVersion() >= 7) {
+ if (locale.getKeywords() == null) {
Locale javaloc = locale.toLocale();
String[] actualWithJavaLocale = Currency.getAvailableCurrencyCodes(javaloc, date);
// should be exactly same with the ULocale version
String[] all = Currency.getKeywordValuesForLocale("currency", loc, false);
// The items in the two collections should match (ignore order,
// behavior change from 4.3.3)
- Set<String> returnedSet = new HashSet<String>();
+ Set<String> returnedSet = new HashSet<>();
returnedSet.addAll(Arrays.asList(all));
assertEquals(loc.toString(), ALLSET, returnedSet);
}
@Test
public void TestCollationKeyword() {
// ICU provider variant is appended
- ULocale uloc0 = new ULocale("de_DE_" + TestUtil.ICU_VARIANT + "@collation=phonebook");
- Locale loc = uloc0.toLocale();
- // On Java 7+, locale extension is preserved
- ULocale uloc = ULocale.forLocale(loc);
- String nsType = uloc.getKeywordValue("collation");
- if (nsType == null) {
- // Java 6 - skip this test
- return;
- }
-
+ ULocale uloc = new ULocale("de_DE_" + TestUtil.ICU_VARIANT + "@collation=phonebook");
+ Locale loc = uloc.toLocale();
Collator jdkColl = Collator.getInstance(loc);
boolean isPhonebook = false;
if (jdkColl instanceof CollatorICU) {
@Test
public void TestCalendarKeyword() {
// ICU provider variant is appended
- ULocale uloc0 = new ULocale("en_US_" + TestUtil.ICU_VARIANT + "@calendar=japanese");
- Locale loc = uloc0.toLocale();
- // On Java 7+, locale extension is preserved
- ULocale uloc = ULocale.forLocale(loc);
- String calType = uloc.getKeywordValue("calendar");
- if (calType == null) {
- // Java 6 - skip this test
- return;
- }
-
+ ULocale uloc = new ULocale("en_US_" + TestUtil.ICU_VARIANT + "@calendar=japanese");
+ Locale loc = uloc.toLocale();
DateFormatSymbols jdkDfs = DateFormatSymbols.getInstance(loc);
com.ibm.icu.text.DateFormatSymbols icuDfs = com.ibm.icu.text.DateFormatSymbols.getInstance(uloc);
@Test
public void TestCalendarKeyword() {
// ICU provider variant is appended
- ULocale uloc0 = new ULocale("en_US_" + TestUtil.ICU_VARIANT + "@calendar=buddhist");
- Locale loc = uloc0.toLocale();
- // On Java 7+, locale extension is preserved
- ULocale uloc = ULocale.forLocale(loc);
- String calType = uloc.getKeywordValue("calendar");
- if (calType == null) {
- // Java 6 - skip this test
- return;
- }
-
+ ULocale uloc = new ULocale("en_US_" + TestUtil.ICU_VARIANT + "@calendar=buddhist");
+ Locale loc = uloc.toLocale();
DateFormat jdkDfmt = DateFormat.getDateInstance(DateFormat.FULL, loc);
Calendar cal = jdkDfmt.getCalendar();
boolean isBuddhist = false;
@Test
public void TestKeywords() {
// ICU provider variant is appended
- ULocale uloc0 = new ULocale("en_US_" + TestUtil.ICU_VARIANT + "@numbers=Arab;currency=EUR");
- Locale loc = uloc0.toLocale();
- // On Java 7+, locale extension is preserved
- ULocale uloc = ULocale.forLocale(loc);
- String nsType = uloc.getKeywordValue("numbers");
- if (nsType == null) {
- // Java 6 - skip this test
- return;
- }
-
+ ULocale uloc = new ULocale("en_US_" + TestUtil.ICU_VARIANT + "@numbers=Arab;currency=EUR");
+ Locale loc = uloc.toLocale();
DecimalFormatSymbols jdkDecfs = DecimalFormatSymbols.getInstance(loc);
com.ibm.icu.text.DecimalFormatSymbols icuDecfs = com.ibm.icu.text.DecimalFormatSymbols.getInstance(uloc);
// Check digit 0
@Test
public void TestKeywords() {
// ICU provider variant is appended
- ULocale uloc0 = new ULocale("en_US_" + TestUtil.ICU_VARIANT + "@numbers=Arab;currency=EUR");
- Locale loc = uloc0.toLocale();
- // On Java 7+, locale extension is preserved
- ULocale uloc = ULocale.forLocale(loc);
- String nsType = uloc.getKeywordValue("numbers");
- if (nsType == null) {
- // Java 6 - skip this test
- return;
- }
-
+ ULocale uloc = new ULocale("en_US_" + TestUtil.ICU_VARIANT + "@numbers=arab;currency=EUR");
+ Locale loc = uloc.toLocale();
NumberFormat jdkNfmt = NumberFormat.getCurrencyInstance(loc);
com.ibm.icu.text.NumberFormat icuNfmt = com.ibm.icu.text.NumberFormat.getCurrencyInstance(uloc);