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

Locale.getAvaliableLocales() returns an empty array

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Duplicate
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5

      Description



      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

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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: