Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1004

DurationFormatUtils#formatDurationHMS implementation does not correspond to Javadoc and vice versa

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.3.2
    • 3.4
    • lang.text.*
    • None

    Description

      This method has several flaws:

      1. Javadoc says: "The format used is ISO8601-like: H:m:s.S." but the method call supplies "H:mm:ss.SSS"
      2. ISO time never omits leading zeros, so the proper pattern must be "HH:mm:ss.SSS"
      3. The method name says: "HMS" but includes the second fraction.

      Since the use of fractions is optional, the method should use "HH:mm:ss" and update the Javadoc as well.

      Attachments

        1. LANG-1004.patch
          5 kB
          Michael Osipov

        Activity

          People

            britter Benedikt Ritter
            michael-o Michael Osipov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: