Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4070178

Locale errors for English (United Kingdom)

XMLWordPrintable

    • 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() );
      }
      }

      }
      }
       

            bcbeck Brian Beck (Inactive)
            kpolomsksunw Krystyna Polomski (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: