IBM Support

IV99686: JAVA.IO.FILE.LASTMODIFIED() DOES NOT PROVIDE MILLISECOND PRECISION ON UNIX PLATFORMS

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Error Message: N/A
    .
    Stack Trace: N/A
    .
    As per the specification, File.lastModified() should provide the
    time in millisecond precision. However, it does not provide
    millisecond precision on Unix platforms and always gave 0s in
    milliseconds position. The milliseconds precision is available
    for windows platform.
    For example:
    On Linux
    Timestamp  : 2017-08-01 16:37:10.0
    On Windows:
    Timestamp  : 2017-08-03 13:13:41.27
    

Local fix

  • Files.getLastModifiedTime(File.toPath()).toMillis() can be used
    instead of File.lastModified()
    

Problem summary

  • On Unix platforms, Java uses the seconds specific data structure
     field of the system call to fetch the modification time.
    

Problem conclusion

  • JDK has been updated to use millisecond specific data structure
    field of the system call to fetch the modification time for
    Linux and AIX platforms.
    
    The issue is addressed in openJDK through
    https://bugs.openjdk.java.net/browse/JDK-8177809
    .
    This APAR will be fixed in the following Java Releases:
       8    SR5 FP5  (8.0.5.5)
       7 R1 SR4 FP15  (7.1.4.15)
       7    SR10 FP15 (7.0.10.15)
    .
    Contact your IBM Product's Service Team for these Service
    Refreshes and Fix Packs.
    For those running stand-alone, information about the available
    Service Refreshes and Fix Packs can be found at:
               https://www.ibm.com/developerworks/java/jdk/
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV99686

  • Reported component name

    JAVA CLASS LIBS

  • Reported component ID

    620700130

  • Reported release

    700

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2017-09-07

  • Closed date

    2017-10-31

  • Last modified date

    2017-10-31

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    JAVA CLASS LIBS

  • Fixed component ID

    620700130

Applicable component levels

  • R700 PSY

       UP

  • R800 PSY

       UP

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSNVBF","label":"Runtimes for Java Technology"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.0","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
21 February 2022