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

Locale.getAvaliableLocales() returns an empty array

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.2.0
    • core-libs
    • sparc
    • solaris_2.5



      Name: dfC67450 Date: 09/24/98



      Locale.ENGLISH no longer present in Collator.getAvailableLocales().
      getAvailableLocales() of NumberFormat, DateFormat and Calendar
      does not containt it also.

      This bug was introduced in JDK1.2-fcsK.

      Here is the test demonstrating the bug:

      -----------------Test.java------------------------
      import java.util.*;
      import java.text.*;

      public class Test {
          public static void main (String args[]){
            Locale[] locales = Collator.getAvailableLocales();
            boolean passed = false;
            for (int i = 0; i < locales.length && !passed; i++) {
              if (locales[i].equals(Locale.US)) {
                 passed = true;
              }
            }

            if (passed) {
              System.out.println("Test passed");
            } else {
              System.out.println("Test failed");
            }
          }
      }
      ---------Output from the test (jdk1.2-fcs-K) ---------------------
      Test failed
      ---------Output from the test (jdk1.2-fcs-J) ---------------------
      Test passed
      -------------------------------------------------



      ======================================================================

      Name: mgC56079 Date: 09/24/98


      The problem is more serious than described above.
      getAvaliableLocales() methods of all classes now return an empty array.

      ==== Yet another test ====
      import java.util.Locale;
      public class LocaleTest {

          public static void main(String[] args) {
              System.out.println(Locale.getAvailableLocales().length);
          }

      }
      ==== Sample run ====
      % java LocaleTest
      0

      ======================================================================

            Unassigned Unassigned
            dfazunensunw Dmitri Fazunenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: