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

File.setLastModified(long) incorrect after calling TimeZone.setDefault()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 1.4.2
    • core-libs
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.4.2_04"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
      Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP Professional Version 2002 Service Pack 1

      A DESCRIPTION OF THE PROBLEM :
      Calling File.setLastModified() results in an incorrect file time if the default TimeZone has been changed prior using TimeZone.setDefault(). The amount of error is equal to the offset between the original default TimeZone and what it was changed to.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Set the default TimeZone to GMT using TimeZone.setDefault().
      Set the last modified on a File using File.setLastModified().
      Observe that the last modified time on the file is incorrect.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expected the File's last modified time to be set correctly.

      ACTUAL -
      The File's last modified time is set incorrectly by the delta between the original VM default TimeZone and its replacement.

      REPRODUCIBILITY :
      This bug can be reproduced always.
      ###@###.### 2004-12-28 12:17:51 GMT

            bpb Brian Burkhalter
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: