33 import java.io.IOException; |
33 import java.io.IOException; |
34 import java.io.Serializable; |
34 import java.io.Serializable; |
35 import java.security.AccessController; |
35 import java.security.AccessController; |
36 import java.security.PrivilegedAction; |
36 import java.security.PrivilegedAction; |
37 import java.util.logging.Level; |
37 import java.util.logging.Level; |
38 import java.util.logging.Logger; |
|
39 import java.util.regex.Pattern; |
38 import java.util.regex.Pattern; |
40 import java.util.regex.Matcher; |
39 import java.util.regex.Matcher; |
41 import java.util.spi.CurrencyNameProvider; |
40 import java.util.spi.CurrencyNameProvider; |
42 import java.util.spi.LocaleServiceProvider; |
41 import java.util.spi.LocaleServiceProvider; |
43 import sun.util.LocaleServiceProviderPool; |
42 import sun.util.LocaleServiceProviderPool; |
|
43 import sun.util.logging.PlatformLogger; |
44 import sun.util.resources.LocaleData; |
44 import sun.util.resources.LocaleData; |
45 import sun.util.resources.OpenListResourceBundle; |
45 import sun.util.resources.OpenListResourceBundle; |
46 |
46 |
47 |
47 |
48 /** |
48 /** |
242 key.toUpperCase(Locale.ROOT), |
242 key.toUpperCase(Locale.ROOT), |
243 props.getProperty(key).toUpperCase(Locale.ROOT)); |
243 props.getProperty(key).toUpperCase(Locale.ROOT)); |
244 } |
244 } |
245 } |
245 } |
246 } catch (IOException e) { |
246 } catch (IOException e) { |
247 log(Level.INFO, "currency.properties is ignored because of an IOException", e); |
247 info("currency.properties is ignored because of an IOException", e); |
248 } |
248 } |
249 return null; |
249 return null; |
250 } |
250 } |
251 }); |
251 }); |
252 } |
252 } |
684 // ignore invalid country code |
684 // ignore invalid country code |
685 String message = new StringBuilder() |
685 String message = new StringBuilder() |
686 .append("The entry in currency.properties for ") |
686 .append("The entry in currency.properties for ") |
687 .append(ctry).append(" is ignored because of the invalid country code.") |
687 .append(ctry).append(" is ignored because of the invalid country code.") |
688 .toString(); |
688 .toString(); |
689 log(Level.INFO, message, null); |
689 info(message, null); |
690 return; |
690 return; |
691 } |
691 } |
692 |
692 |
693 Matcher m = pattern.matcher(curdata); |
693 Matcher m = pattern.matcher(curdata); |
694 if (!m.find()) { |
694 if (!m.find()) { |
696 String message = new StringBuilder() |
696 String message = new StringBuilder() |
697 .append("The entry in currency.properties for ") |
697 .append("The entry in currency.properties for ") |
698 .append(ctry) |
698 .append(ctry) |
699 .append(" is ignored because the value format is not recognized.") |
699 .append(" is ignored because the value format is not recognized.") |
700 .toString(); |
700 .toString(); |
701 log(Level.INFO, message, null); |
701 info(message, null); |
702 return; |
702 return; |
703 } |
703 } |
704 |
704 |
705 String code = m.group(1); |
705 String code = m.group(1); |
706 int numeric = Integer.parseInt(m.group(2)); |
706 int numeric = Integer.parseInt(m.group(2)); |
724 (index + SPECIAL_CASE_COUNTRY_INDEX_DELTA); |
724 (index + SPECIAL_CASE_COUNTRY_INDEX_DELTA); |
725 } |
725 } |
726 setMainTableEntry(ctry.charAt(0), ctry.charAt(1), entry); |
726 setMainTableEntry(ctry.charAt(0), ctry.charAt(1), entry); |
727 } |
727 } |
728 |
728 |
729 private static void log(Level level, String message, Throwable t) { |
729 private static void info(String message, Throwable t) { |
730 Logger logger = Logger.getLogger("java.util.Currency"); |
730 PlatformLogger logger = PlatformLogger.getLogger("java.util.Currency"); |
731 if (logger.isLoggable(level)) { |
731 if (logger.isLoggable(PlatformLogger.INFO)) { |
732 if (t != null) { |
732 if (t != null) { |
733 logger.log(level, message, t); |
733 logger.info(message, t); |
734 } else { |
734 } else { |
735 logger.log(level, message); |
735 logger.info(message); |
736 } |
736 } |
737 } |
737 } |
738 } |
738 } |
739 } |
739 } |