Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-3989

DataTypeUtils handles isLongTypeCompatible, isDoubleTypeCompatible, etc. poorly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0
    • Extensions
    • None

    Description

      DataTypeUtils is used to coerce an object of one type into an object of another type for record-oriented data. However, the isLongTypeCompatible method is calling Long.parseLong and catch NumberFormatException to check if a String is a valid Long, instead of iterating over each character in the string and checking Character.isDigit. We can also use the regex defined by JavaDocs for Double.parseDouble to handle the case of checking if a String is Double-type capable.

      Attachments

        Issue Links

          Activity

            People

              markap14 Mark Payne
              markap14 Mark Payne
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: