JDK-4013314 : Alaska time zone should have daylight savings time
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 1.1
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_2.5
  • CPU: sparc
  • Submitted: 1996-11-07
  • Updated: 1997-07-23
  • Resolved: 1997-07-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.1 1.1fcsFixed
Related Reports
Relates :  
Description
Time zone class incorrectly reports that Alaska does not have daylight time.

Steps to reproduce
Compile and run the attached code.  
You will need two JavaTest harness classes:
javasoft.sqe.harness.Test and javasoft.sqe.harness.Status.

import java.io.PrintStream;
import javasoft.sqe.harness.Status;
import javasoft.sqe.harness.Test;

import java.util.TimeZone;

public class ZoneTester implements Test {

    public static void main( String argv[] ) {
        ZoneTester test = new ZoneTester();
        Status status = test.run( argv, System.err, System.out );
        status.exit();
    }

    public Status run( String argv[], PrintStream log, PrintStream out ) {
        boolean expectedResult = true;
        String timeZoneID = "AST";
        int i;

        for( i = 0; i < argv.length - 1; ++i ) {
            if( argv[i].equals( "-Expected" ) ) {
                expectedResult = new Boolean( argv[++i] ).booleanValue();
            }
            else if( argv[i].equals( "-TimeZoneID" ) ) {
                timeZoneID = argv[++i];
            }
        }
        
        TimeZone testTimeZone = TimeZone.getTimeZone( timeZoneID );
        out.println( "Testing time zone: " + testTimeZone.getID() );
        if( testTimeZone.useDaylightTime( ) != expectedResult ) {
            return Status.failed( "Expected: " + expectedResult + 
                                  " received: " + 
                                  testTimeZone.useDaylightTime( ) );
        }
        else {
            return Status.passed( "OKAY" );
        }
    }
}

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic FIXED IN: 1.1fcs INTEGRATED IN: 1.1fcs VERIFIED IN: 1.1.4
14-06-2004

EVALUATION This looks like an easy fix to java.util.TimeZoneData. On the other hand, there's a bunch of what appears to be duplicated data in java.util.TimeZone. For example, what's the correspondence between the representative cities in TimeZone and the zone ID's in TimeZoneData? Maybe I just don't understand the code, or maybe there's some cleanup that hasn't happened. (I also notice a comment in TimeZone that says "// BRIAN FIXME".) Does the spec for getTimeZone(String) say that it returns PST if it can't load the resource bundle, e.g. rather than a null or an exception? peter.kessler@Eng 1996-11-07
07-11-1996