-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
1.1.4
-
generic
-
generic
Locale errors for English (United Kingdom)
Wrong data is being reported for the following locale methods
for the EN UK locale:
method jdk-sparkler output should be
-------- ------------------- -----------
getISO3Country USA GBR
getDisplayCountry United States United Kingdom
getDisplayName English (United States) English (United Kingdom)
getCountry UK GB
Compile and run the following test code:
-------------------------------------------------------------------------------------
import java.util.Locale;
class test {
public static void main (String argv[]) {
String expectedISO3Country = "GBR";
String expectedDisplayCountry = "United Kingdom";
String expectedDisplayName = "English (United Kingdom)";
String expectedCountry = "GB";
Locale locale = new Locale("EN", "UK");
if ((locale.getISO3Country()) == expectedISO3Country ) {
System.out.println ("Passed.");
} else {
System.out.println ("Failed getISO3Country:" +
" Expected: " + expectedISO3Country +
" Received: " + locale.getISO3Country() );
}
if ((locale.getDisplayCountry()) == expectedDisplayCountry ) {
System.out.println ("Passed.");
} else {
System.out.println ("Failed getDisplayCountry:" +
" Expected: " + expectedDisplayCountry +
" Received: " + locale.getDisplayCountry() );
}
if ((locale.getDisplayName()) == expectedDisplayName ) {
System.out.println ("Passed.");
} else {
System.out.println ("Failed DisplayName:" +
" Expected: " + expectedDisplayName +
" Received: " + locale.getDisplayName() );
if ((locale.getCountry()) == expectedCountry ) {
System.out.println ("Passed.");
} else {
System.out.println ("Failed getCountry:" +
" Expected: " + expectedCountry +
" Received: " + locale.getCountry() );
}
}
}
}
Wrong data is being reported for the following locale methods
for the EN UK locale:
method jdk-sparkler output should be
-------- ------------------- -----------
getISO3Country USA GBR
getDisplayCountry United States United Kingdom
getDisplayName English (United States) English (United Kingdom)
getCountry UK GB
Compile and run the following test code:
-------------------------------------------------------------------------------------
import java.util.Locale;
class test {
public static void main (String argv[]) {
String expectedISO3Country = "GBR";
String expectedDisplayCountry = "United Kingdom";
String expectedDisplayName = "English (United Kingdom)";
String expectedCountry = "GB";
Locale locale = new Locale("EN", "UK");
if ((locale.getISO3Country()) == expectedISO3Country ) {
System.out.println ("Passed.");
} else {
System.out.println ("Failed getISO3Country:" +
" Expected: " + expectedISO3Country +
" Received: " + locale.getISO3Country() );
}
if ((locale.getDisplayCountry()) == expectedDisplayCountry ) {
System.out.println ("Passed.");
} else {
System.out.println ("Failed getDisplayCountry:" +
" Expected: " + expectedDisplayCountry +
" Received: " + locale.getDisplayCountry() );
}
if ((locale.getDisplayName()) == expectedDisplayName ) {
System.out.println ("Passed.");
} else {
System.out.println ("Failed DisplayName:" +
" Expected: " + expectedDisplayName +
" Received: " + locale.getDisplayName() );
if ((locale.getCountry()) == expectedCountry ) {
System.out.println ("Passed.");
} else {
System.out.println ("Failed getCountry:" +
" Expected: " + expectedCountry +
" Received: " + locale.getCountry() );
}
}
}
}