if (currencyFormatter == null) { currencyFormatter = (DecimalFormat) NumberFormat.getCurrencyInstance(getLocale()); } return currencyFormatter; } char getDecimalGroupSeparator() { if (decimalSeparator == 0) { DecimalFormatSymbols symbols = new DecimalFormatSymbols(getLocale()); decimalSeparator = (new Character(symbols.getGroupingSeparator())).charValue(); } return decimalSeparator;
/** * Reset thread local variables. For example this can be called when an application is 'undeployed'. * This was done to fix a memory leak in tomcat that happened when the app context was destroyed. * The context couldn't be properly destroyed as objects were still in the threadlocal map. */ public static void reset() { formatterStorage = new ThreadLocalFormatterStorage(); }
/** * @return Returns the thread associated, locale specific formatters */ private static Formatters getFormatters() { return (Formatters) formatterStorage.get(); }