Uploaded image for project: 'Kuali Rice Development'
  1. Kuali Rice Development
  2. KULRICE-3654

DateTimeServiceImpl.java parse method does not check for Valid Dates

    Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0, 1.0.1
    • Fix Version/s: 1.0.1
    • Component/s: Data Dictionary
    • Labels:
      None
    • Rice Module:
      KNS
    • Application Requirement:
      Rice

      Description

      In DateTimeServiceImpl::parse it calls the standard DateFormat.parse method. While this method does validate based on structure, it does not check if the actual date parsed is valid.

      So, with a format string of MM/dd/yyyy and an input date of 02/31/2009 the parse method would throw no error even though the date does not exist.

      If this method just checked structure and returned a boolean, then this would be fine, but it returns a date object. So while the above throws no errors, it does have an odd side effect of rolling the extra days over.

      So the above would become 03/02/2009, which is invalid.

      So the fix I will be implementing will make sure the date is valid and throw a parse error if the date parsed does not exist.

      I've put this as a forced change because if you were just using this method to check format then it will no longer work as you expected.

        Attachments

          Activity

          Hide
          ewestfal Eric Westfall added a comment -

          SHould have been resolved by KULRICE-3311.

          Show
          ewestfal Eric Westfall added a comment - SHould have been resolved by KULRICE-3311 .

            People

            • Assignee:
              gtaylor Garey Taylor
              Reporter:
              gtaylor Garey Taylor
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: