Uploaded image for project: 'OpenFlowPlugin'
  1. OpenFlowPlugin
  2. OPNFLWPLUG-1066

Inappropriate use of Objects.isNull() and Objects.nonNull()

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Medium
    • Resolution: Done
    • None
    • Sodium
    • General
    • None

    Description

      The codebase currently uses the following idiom

      Object foo;
      if (Objects.isNull(foo)) {
          // ...
      }
      

      While this works, it is a misuse of these two methods, which are documented as:

      API Note:
      This method exists to be used as a Predicate, filter(Objects::isNull)

      It also has two down sides:

       

      Attachments

        # Subject Branch Project Status CR V

        Activity

          People

            rovarga Robert Varga
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: