Java Code Examples for sun.util.calendar.ZoneInfoFile#useOldMapping()

The following examples show how to use sun.util.calendar.ZoneInfoFile#useOldMapping() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TimeZone.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
private ZoneId toZoneId0() {
    String id = getID();
    TimeZone defaultZone = defaultTimeZone;
    // are we not defaultTimeZone but our id is equal to default's?
    if (defaultZone != this &&
        defaultZone != null && id.equals(defaultZone.getID())) {
        // delegate to default TZ which is effectively immutable
        return defaultZone.toZoneId();
    }
    // derive it ourselves
    if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
        if ("EST".equals(id))
            return ZoneId.of("America/New_York");
        if ("MST".equals(id))
            return ZoneId.of("America/Denver");
        if ("HST".equals(id))
            return ZoneId.of("America/Honolulu");
    }
    return ZoneId.of(id, ZoneId.SHORT_IDS);
}
 
Example 2
Source File: TimeZone.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private ZoneId toZoneId0() {
    String id = getID();
    TimeZone defaultZone = defaultTimeZone;
    // are we not defaultTimeZone but our id is equal to default's?
    if (defaultZone != this &&
        defaultZone != null && id.equals(defaultZone.getID())) {
        // delegate to default TZ which is effectively immutable
        return defaultZone.toZoneId();
    }
    // derive it ourselves
    if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
        if ("EST".equals(id))
            return ZoneId.of("America/New_York");
        if ("MST".equals(id))
            return ZoneId.of("America/Denver");
        if ("HST".equals(id))
            return ZoneId.of("America/Honolulu");
    }
    return ZoneId.of(id, ZoneId.SHORT_IDS);
}
 
Example 3
Source File: TimeZone.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Converts this {@code TimeZone} object to a {@code ZoneId}.
 *
 * @return a {@code ZoneId} representing the same time zone as this
 *         {@code TimeZone}
 * @since 1.8
 */
public ZoneId toZoneId() {
    String id = getID();
    if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
        if ("EST".equals(id))
            return ZoneId.of("America/New_York");
        if ("MST".equals(id))
            return ZoneId.of("America/Denver");
        if ("HST".equals(id))
            return ZoneId.of("America/Honolulu");
    }
    return ZoneId.of(id, ZoneId.SHORT_IDS);
}
 
Example 4
Source File: TimeZone.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Converts this {@code TimeZone} object to a {@code ZoneId}.
 *
 * @return a {@code ZoneId} representing the same time zone as this
 *         {@code TimeZone}
 * @since 1.8
 */
public ZoneId toZoneId() {
    String id = getID();
    if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
        if ("EST".equals(id))
            return ZoneId.of("America/New_York");
        if ("MST".equals(id))
            return ZoneId.of("America/Denver");
        if ("HST".equals(id))
            return ZoneId.of("America/Honolulu");
    }
    return ZoneId.of(id, ZoneId.SHORT_IDS);
}
 
Example 5
Source File: TimeZone.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Converts this {@code TimeZone} object to a {@code ZoneId}.
 *
 * @return a {@code ZoneId} representing the same time zone as this
 *         {@code TimeZone}
 * @since 1.8
 */
public ZoneId toZoneId() {
    String id = getID();
    if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
        if ("EST".equals(id))
            return ZoneId.of("America/New_York");
        if ("MST".equals(id))
            return ZoneId.of("America/Denver");
        if ("HST".equals(id))
            return ZoneId.of("America/Honolulu");
    }
    return ZoneId.of(id, ZoneId.SHORT_IDS);
}
 
Example 6
Source File: TimeZone.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Converts this {@code TimeZone} object to a {@code ZoneId}.
 *
 * @return a {@code ZoneId} representing the same time zone as this
 *         {@code TimeZone}
 * @since 1.8
 */
public ZoneId toZoneId() {
    String id = getID();
    if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
        if ("EST".equals(id))
            return ZoneId.of("America/New_York");
        if ("MST".equals(id))
            return ZoneId.of("America/Denver");
        if ("HST".equals(id))
            return ZoneId.of("America/Honolulu");
    }
    return ZoneId.of(id, ZoneId.SHORT_IDS);
}
 
Example 7
Source File: TimeZone.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Converts this {@code TimeZone} object to a {@code ZoneId}.
 *
 * @return a {@code ZoneId} representing the same time zone as this
 *         {@code TimeZone}
 * @since 1.8
 */
public ZoneId toZoneId() {
    String id = getID();
    if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
        if ("EST".equals(id))
            return ZoneId.of("America/New_York");
        if ("MST".equals(id))
            return ZoneId.of("America/Denver");
        if ("HST".equals(id))
            return ZoneId.of("America/Honolulu");
    }
    return ZoneId.of(id, ZoneId.SHORT_IDS);
}
 
Example 8
Source File: TimeZone.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Converts this {@code TimeZone} object to a {@code ZoneId}.
 *
 * @return a {@code ZoneId} representing the same time zone as this
 *         {@code TimeZone}
 * @since 1.8
 */
public ZoneId toZoneId() {
    String id = getID();
    if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
        if ("EST".equals(id))
            return ZoneId.of("America/New_York");
        if ("MST".equals(id))
            return ZoneId.of("America/Denver");
        if ("HST".equals(id))
            return ZoneId.of("America/Honolulu");
    }
    return ZoneId.of(id, ZoneId.SHORT_IDS);
}
 
Example 9
Source File: TimeZone.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Converts this {@code TimeZone} object to a {@code ZoneId}.
 *
 * @return a {@code ZoneId} representing the same time zone as this
 *         {@code TimeZone}
 * @since 1.8
 */
public ZoneId toZoneId() {
    String id = getID();
    if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
        if ("EST".equals(id))
            return ZoneId.of("America/New_York");
        if ("MST".equals(id))
            return ZoneId.of("America/Denver");
        if ("HST".equals(id))
            return ZoneId.of("America/Honolulu");
    }
    return ZoneId.of(id, ZoneId.SHORT_IDS);
}
 
Example 10
Source File: TimeZone.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
/**
 * Converts this {@code TimeZone} object to a {@code ZoneId}.
 *
 * @return a {@code ZoneId} representing the same time zone as this
 *         {@code TimeZone}
 * @since 1.8
 */
public ZoneId toZoneId() {
    String id = getID();
    if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
        if ("EST".equals(id))
            return ZoneId.of("America/New_York");
        if ("MST".equals(id))
            return ZoneId.of("America/Denver");
        if ("HST".equals(id))
            return ZoneId.of("America/Honolulu");
    }
    return ZoneId.of(id, ZoneId.SHORT_IDS);
}
 
Example 11
Source File: TimeZone.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Converts this {@code TimeZone} object to a {@code ZoneId}.
 *
 * @return a {@code ZoneId} representing the same time zone as this
 *         {@code TimeZone}
 * @since 1.8
 */
public ZoneId toZoneId() {
    String id = getID();
    if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
        if ("EST".equals(id))
            return ZoneId.of("America/New_York");
        if ("MST".equals(id))
            return ZoneId.of("America/Denver");
        if ("HST".equals(id))
            return ZoneId.of("America/Honolulu");
    }
    return ZoneId.of(id, ZoneId.SHORT_IDS);
}
 
Example 12
Source File: TimeZone.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Converts this {@code TimeZone} object to a {@code ZoneId}.
 *
 * @return a {@code ZoneId} representing the same time zone as this
 *         {@code TimeZone}
 * @since 1.8
 */
public ZoneId toZoneId() {
    String id = getID();
    if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
        if ("EST".equals(id))
            return ZoneId.of("America/New_York");
        if ("MST".equals(id))
            return ZoneId.of("America/Denver");
        if ("HST".equals(id))
            return ZoneId.of("America/Honolulu");
    }
    return ZoneId.of(id, ZoneId.SHORT_IDS);
}
 
Example 13
Source File: TimeZone.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Converts this {@code TimeZone} object to a {@code ZoneId}.
 *
 * @return a {@code ZoneId} representing the same time zone as this
 *         {@code TimeZone}
 * @since 1.8
 */
public ZoneId toZoneId() {
    String id = getID();
    if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
        if ("EST".equals(id))
            return ZoneId.of("America/New_York");
        if ("MST".equals(id))
            return ZoneId.of("America/Denver");
        if ("HST".equals(id))
            return ZoneId.of("America/Honolulu");
    }
    return ZoneId.of(id, ZoneId.SHORT_IDS);
}
 
Example 14
Source File: TimeZone.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Converts this {@code TimeZone} object to a {@code ZoneId}.
 *
 * @return a {@code ZoneId} representing the same time zone as this
 *         {@code TimeZone}
 * @since 1.8
 */
public ZoneId toZoneId() {
    String id = getID();
    if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
        if ("EST".equals(id))
            return ZoneId.of("America/New_York");
        if ("MST".equals(id))
            return ZoneId.of("America/Denver");
        if ("HST".equals(id))
            return ZoneId.of("America/Honolulu");
    }
    return ZoneId.of(id, ZoneId.SHORT_IDS);
}
 
Example 15
Source File: TimeZone.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Converts this {@code TimeZone} object to a {@code ZoneId}.
 *
 * @return a {@code ZoneId} representing the same time zone as this
 *         {@code TimeZone}
 * @since 1.8
 */
public ZoneId toZoneId() {
    String id = getID();
    if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
        if ("EST".equals(id))
            return ZoneId.of("America/New_York");
        if ("MST".equals(id))
            return ZoneId.of("America/Denver");
        if ("HST".equals(id))
            return ZoneId.of("America/Honolulu");
    }
    return ZoneId.of(id, ZoneId.SHORT_IDS);
}
 
Example 16
Source File: TimeZone.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Converts this {@code TimeZone} object to a {@code ZoneId}.
 *
 * @return a {@code ZoneId} representing the same time zone as this
 *         {@code TimeZone}
 * @since 1.8
 */
public ZoneId toZoneId() {
    String id = getID();
    if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
        if ("EST".equals(id))
            return ZoneId.of("America/New_York");
        if ("MST".equals(id))
            return ZoneId.of("America/Denver");
        if ("HST".equals(id))
            return ZoneId.of("America/Honolulu");
    }
    return ZoneId.of(id, ZoneId.SHORT_IDS);
}
 
Example 17
Source File: TimeZone.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Converts this {@code TimeZone} object to a {@code ZoneId}.
 *
 * @return a {@code ZoneId} representing the same time zone as this
 *         {@code TimeZone}
 * @since 1.8
 */
public ZoneId toZoneId() {
    String id = getID();
    if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
        if ("EST".equals(id))
            return ZoneId.of("America/New_York");
        if ("MST".equals(id))
            return ZoneId.of("America/Denver");
        if ("HST".equals(id))
            return ZoneId.of("America/Honolulu");
    }
    return ZoneId.of(id, ZoneId.SHORT_IDS);
}