JDK-7092169 : Wrong currency code for slovakia
  • Type: Bug
  • Component: globalization
  • Sub-Component: translation
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2011-09-19
  • Updated: 2012-03-20
  • Resolved: 2011-09-20
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux praetsch 2.6.34.10-0.2-desktop #1 SMP PREEMPT 2011-07-20 18:48:56 +0200 x86_64 x86_64 x86_64 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
"Since 1st of January 2009, the official currency in Slovakia is Euro (currency code EUR). "
http://www.slovak-republic.org/currency/

But Java gives the old code 'SKK' back.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
~> cat TestClass.java
import java.util.Currency;
import java.util.Locale;

public class TestClass {
    public static void main(String[] args) {
        System.out.println(Currency.getInstance(new Locale("sk", "sk")).getCurrencyCode());
        System.out.println(System.getProperty("java.version"));
    }
}

~> ./downloads/jdk1.7.0/bin/javac TestClass.java
~> ./downloads/jdk1.7.0/bin/java TestClass
SKK
1.7.0
~> ./downloads/jdk1.7.0/bin/java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Currency.getInstance(new Locale("sk", "sk")).getCurrencyCode() must be "EUR"
ACTUAL -
Currency.getInstance(new Locale("sk", "sk")).getCurrencyCode() is "SKK"

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.util.Currency;
import java.util.Locale;

public class TestClass {
    public static void main(String[] args) {
        System.out.println(Currency.getInstance(new Locale("sk", "sk")).getCurrencyCode());
    }
}

---------- END SOURCE ----------

Comments
EVALUATION Yes, the fix is included in 7066203, which is integrated in Java 8 and 7u2.
2011-09-20

EVALUATION Looks like a dup of 7066203.
2011-09-19