Harmony
  1. Harmony
  2. HARMONY-502

SimpleDateFormat doesn't parse hours/minutes/seconds prefixed by spaces

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib
    • Labels:
      None

      Description

      Given the format "HH:mm:ss", the RI accepts strings like "<space>9:08:07", "9:<space>8:07", "9:08:<space>7", "<tab>9:08:07", etc. Harmony doesn't parse these correctly.

        Activity

        Mark Hindess created issue -
        Hide
        Mark Hindess added a comment -

        Patch with tests and fix.

        While trying to come up with a fix, I first thought that only spaces would be allowed (and yes multiple spaces do seem to be accepted). But I think noticed that tabs we permitted. I then tested other whitespace - none of which was accepted. Since I'd done this I also included the negative tests for the invalid whitespace for completeness.

        Show
        Mark Hindess added a comment - Patch with tests and fix. While trying to come up with a fix, I first thought that only spaces would be allowed (and yes multiple spaces do seem to be accepted). But I think noticed that tabs we permitted. I then tested other whitespace - none of which was accepted. Since I'd done this I also included the negative tests for the invalid whitespace for completeness.
        Mark Hindess made changes -
        Field Original Value New Value
        Attachment simpledateformat.with.space.diff [ 12334523 ]
        Mikhail Loenko made changes -
        Assignee Mikhail Loenko [ mloenko ]
        Hide
        Mikhail Loenko added a comment -

        fixed in revision 409591
        Mark, please verify that it fully resolves the issue

        Show
        Mikhail Loenko added a comment - fixed in revision 409591 Mark, please verify that it fully resolves the issue
        Mikhail Loenko made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        Mark Hindess added a comment -

        Looks good. Thanks Mikhail.

        Show
        Mark Hindess added a comment - Looks good. Thanks Mikhail.
        Hide
        Mikhail Loenko added a comment -

        verified by Mark

        Show
        Mikhail Loenko added a comment - verified by Mark
        Mikhail Loenko made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Mikhail Loenko
            Reporter:
            Mark Hindess
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development