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

Regression: TimeZone.getAvailableIDs(int) is broken in Kestrel "I"

XMLWordPrintable

    • beta
    • generic, sparc
    • generic, solaris_2.5



      Name: mgC56079 Date: 06/29/99


      TimeZone.getAvailableIDs(int rawOffset) is broken in Kestrel "I" and is no longer
      consistent with TimeZone.getAvailableIDs().
      This causes JCK1.2a, 1.2.2, kestrel-ea failure:
      api/java_util/TimeZone/index.html#static

      TimeZone.getAvailableIDs(int) no longer returns the whole set of time zones
      with the given offset. E.g. TimeZone.getAvailableIDs(18000000) returns only
      one id, while TimeZone.getAvailableIDs() returns 11 time zones with raw
      offset 18000000.

      Here is a minimized test:
      --------- TZ.java -----------
      import java.util.TimeZone;
      public class TZ {

          public static void main(String args[]) {

              String[] ids;
              ids = TimeZone.getAvailableIDs();
              for (int i = 0; i < ids.length; i++) {
                  if (TimeZone.getTimeZone(ids[i]).getRawOffset() == 18000000)
                      System.out.println(ids[i]);
              }
              System.out.println("-----");
              ids = TimeZone.getAvailableIDs(18000000);
              for (int i = 0; i < ids.length; i++) {
                  System.out.println(ids[i]);
              }
          }


      }
      --------- sample run (JDK1.2.2, correct: both list are the same) -----------
      java TZ
      Indian/Kerguelen
      Asia/Tbilisi
      Indian/Chagos
      Indian/Maldives
      Asia/Dushanbe
      Asia/Ashkhabad
      Asia/Tashkent
      Asia/Karachi
      PLT
      Asia/Bishkek
      Asia/Aqtobe
      Asia/Yekaterinburg
      -----
      Indian/Kerguelen
      Asia/Tbilisi
      Indian/Chagos
      Indian/Maldives
      Asia/Dushanbe
      Asia/Ashkhabad
      Asia/Tashkent
      Asia/Karachi
      PLT
      Asia/Bishkek
      Asia/Aqtobe
      Asia/Yekaterinburg
      --------- sample run (JDK1.3 I, WRONG: the second list is bogus) -----------
      % java TZ
      Indian/Kerguelen
      Indian/Chagos
      Indian/Maldives
      Asia/Dushanbe
      Asia/Ashkhabad
      Asia/Tashkent
      Asia/Karachi
      PLT
      Asia/Bishkek
      Asia/Aqtobe
      Asia/Yekaterinburg
      -----
      Indian/Kerguelen

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

            ktakahassunw Koushi Takahashi (Inactive)
            gorsunw Gor Gor (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: