Print this page
rev 5696 : 6336885: RFE: Locale Data Deployment Enhancements
4609153: Provide locale data for Indic locales
5104387: Support for gl_ES locale (galician language)
6337471: desktop/system locale preferences support
7056139: (cal) SPI support for locale-dependent Calendar parameters
7058206: Provide CalendarData SPI for week params and display field value names
7073852: Support multiple scripts for digits and decimal symbols per locale
7079560: [Fmt-Da] Context dependent month names support in SimpleDateFormat
7171324: getAvailableLocales() of locale sensitive services should return the actual availability of locales
7151414: (cal) Support calendar type identification
7168528: LocaleServiceProvider needs to be aware of Locale extensions
7171372: (cal) locale's default Calendar should be created if unknown calendar is specified
Summary: JEP 127: Improve Locale Data Packaging and Adopt Unicode CLDR Data (part 1 w/o packaging changes. by Naoto Sato and Masayoshi Okutsu)

Split Close
Expand all
Collapse all
          --- old/src/share/classes/java/util/TimeZone.java
          +++ new/src/share/classes/java/util/TimeZone.java
↓ open down ↓ 38 lines elided ↑ open up ↑
  39   39  package java.util;
  40   40  
  41   41  import java.io.Serializable;
  42   42  import java.lang.ref.SoftReference;
  43   43  import java.security.AccessController;
  44   44  import java.security.PrivilegedAction;
  45   45  import java.util.concurrent.ConcurrentHashMap;
  46   46  import sun.misc.SharedSecrets;
  47   47  import sun.misc.JavaAWTAccess;
  48   48  import sun.security.action.GetPropertyAction;
  49      -import sun.util.TimeZoneNameUtility;
       49 +import sun.util.locale.provider.TimeZoneNameUtility;
  50   50  import sun.util.calendar.ZoneInfo;
  51   51  import sun.util.calendar.ZoneInfoFile;
  52   52  
  53   53  /**
  54   54   * <code>TimeZone</code> represents a time zone offset, and also figures out daylight
  55   55   * savings.
  56   56   *
  57   57   * <p>
  58   58   * Typically, you get a <code>TimeZone</code> using <code>getDefault</code>
  59   59   * which creates a <code>TimeZone</code> based on the time zone where the program
↓ open down ↓ 336 lines elided ↑ open up ↑
 396  396       * @see java.text.DateFormatSymbols#getZoneStrings()
 397  397       */
 398  398      public String getDisplayName(boolean daylight, int style, Locale locale) {
 399  399          if (style != SHORT && style != LONG) {
 400  400              throw new IllegalArgumentException("Illegal style: " + style);
 401  401          }
 402  402  
 403  403          String id = getID();
 404  404          String[] names = getDisplayNames(id, locale);
 405  405          if (names == null) {
 406      -            if (id.startsWith("GMT")) {
      406 +            if (id.startsWith("GMT") && id.length() > 3) {
 407  407                  char sign = id.charAt(3);
 408  408                  if (sign == '+' || sign == '-') {
 409  409                      return id;
 410  410                  }
 411  411              }
 412  412              int offset = getRawOffset();
 413  413              if (daylight) {
 414  414                  offset += getDSTSavings();
 415  415              }
 416  416              return ZoneInfoFile.toCustomID(offset);
↓ open down ↓ 506 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX