-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
8u192
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
According to the java.util.Currency API: Users can supersede the Java runtime currency data by creating a properties file named <JAVA_HOME>/lib/currency.properties.
currency.properties supersede doesn't work for NOK (Norwegian krone) currency code.
It's not possible, for example, to change to 0 the default fraction digits for the NOK currency code through the currency.properties:
NO=NOK,578,0
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create currency.properties file that looks like this:
NO=NOK,578,0
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The default fraction digits for the NOK currency should change to 0
ACTUAL -
Getting an exception:
Exception in thread "main" java.lang.IllegalArgumentException
at java.util.Currency.getInstance(Currency.java:345)
at java.util.Currency.getInstance(Currency.java:310)
at test.testCurrency.main(testCurrency.java:9)
---------- BEGIN SOURCE ----------
import java.util.Currency;
public class testCurrency {
public static void main(String[] args) {
Currency curr = Currency.getInstance("NOK");
System.out.println(curr.getDefaultFractionDigits());
}
}
---------- END SOURCE ----------
FREQUENCY : always
According to the java.util.Currency API: Users can supersede the Java runtime currency data by creating a properties file named <JAVA_HOME>/lib/currency.properties.
currency.properties supersede doesn't work for NOK (Norwegian krone) currency code.
It's not possible, for example, to change to 0 the default fraction digits for the NOK currency code through the currency.properties:
NO=NOK,578,0
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create currency.properties file that looks like this:
NO=NOK,578,0
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The default fraction digits for the NOK currency should change to 0
ACTUAL -
Getting an exception:
Exception in thread "main" java.lang.IllegalArgumentException
at java.util.Currency.getInstance(Currency.java:345)
at java.util.Currency.getInstance(Currency.java:310)
at test.testCurrency.main(testCurrency.java:9)
---------- BEGIN SOURCE ----------
import java.util.Currency;
public class testCurrency {
public static void main(String[] args) {
Currency curr = Currency.getInstance("NOK");
System.out.println(curr.getDefaultFractionDigits());
}
}
---------- END SOURCE ----------
FREQUENCY : always
- duplicates
-
JDK-7102969 currency.properties supercede not working correctly
-
- Resolved
-