JDK-6795560 : ISO 3166-1 - missing 4 ISO codes
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2009-01-20
  • Updated: 2011-02-16
  • Resolved: 2009-01-20
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
JRE 1.6.0_07

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP version 5.1.2600

A DESCRIPTION OF THE PROBLEM :
I have noticed that the list of ISO 3166-1 codes listed in java.util.Locale is not complete. It contains 242 codes instead of 246 officially. The JE (Jersey) code is missing for example.

The following code returns 242 ISO codes

String[] isoCountries = java.util.Locale.getISOCountries();
System.out.println("nbr of ISO: "+isoCountries.length);
for(int i = 0; i<isoCountries.length;i++) {
System.out.println(isoCountries[i]);
}

nbr of ISO: 242
AD
AE
AF
....

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
String[] isoCountries = java.util.Locale.getISOCountries();
System.out.println("nbr of ISO: "+isoCountries.length);
for(int i = 0; i<isoCountries.length;i++) {
System.out.println(isoCountries[i]);
}

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
We should get 246 codes, but we get 242

nbr of ISO: 242

REPRODUCIBILITY :
This bug can be reproduced always.

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


public class TestLocale {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		String[] isoCountries = java.util.Locale.getISOCountries();
		
		System.out.println("nbr of ISO: "+isoCountries.length);
		for(int i = 0; i<isoCountries.length;i++) {
			System.out.println(isoCountries[i]);
		}

	}

}
---------- END SOURCE ----------

Comments
EVALUATION 6544471 addresses three missing codes, i.e., "GG", "JE", and "IM". 6627549 addresses two missing codes, i.e., "BL" and "MF". So the total number will be 247 on JDK6, as we intentionally keep "CS" which doesn't exist anymore in ISO-3166 list for compatibility. For JDK7 we will be removing "CS" with the bug id 6786276.
20-01-2009