commit | 771f3129d213c4725c5a78c6a4ae86ea1b015968 | [log] [tgz] |
---|---|---|
author | Elliott Hughes <enh@google.com> | Tue Jan 26 17:55:25 2010 -0800 |
committer | Elliott Hughes <enh@google.com> | Tue Jan 26 17:55:25 2010 -0800 |
tree | d4bb8d3bd99c4544380c2155d9f7ab7e93cc4873 | |
parent | bdca5d668ebf34b769b9764a75d5bc12219579a5 [diff] |
Add a cache to Currency.getInstance(Locale). Statically there are lots of calls to Currency.getInstance(String) in the core libraries and only one to Currency.getInstance(Locale). This might be why the former has a cache but the latter doesn't. Dynamically, looking up Currency by Locale is a common operation because that one caller -- DecimalFormatSymbols -- is widely used, and it sets up its currency data eagerly. (Which might be worth coming back and also fixing later.)