Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-8471

Remove uneccessary call of isNotEmpty() to validate not null generic value

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 16.11.01
    • Fix Version/s: None
    • Component/s: ALL COMPONENTS
    • Labels:
      None

      Description

      There are lots of places in code where we have used UtilValidate.isNotEmpty() to validate GenericValue object. GenericValue will always be null or not null, they will never empty. So instead of using utility method to validate them we should be using native checks onwards.

      Example:
      Currently we are validating generic value in following ways

      if (UtilValidate.isNotEmpty(acctgTransEntry)) {
      

      instead we will using it in this way:

      if (acctgTransEntry != null ) { 
      

      Basically these validation methods should preferably be used on Strings or Lists and normal Maps.

        Attachments

        1. OFBIZ-8471.patch
          97 kB
          Ratnesh Upadhyay

          Issue Links

            Activity

              People

              • Assignee:
                diveshdut Divesh Dutta
                Reporter:
                upadhyay.ratnesh Ratnesh Upadhyay
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: