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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.4.2
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: