Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-401

Policy concerning "null"

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2
    • Labels:
      None

      Description

      Following the discussion on the "dev" ML, it appears that it would be fine to not check for null references within CM. The JVM will do it anyway so that it is redundant and not necessary most of the time (i.e. when usage is valid). When it happens, the problem is obvious enough that the standard NullPointerException fully describes it, without the need for additional specific and localized detailed messages.
      Hence we could remove all explicit checks for null. Or when early failure is preferred, make the check and throw NullPointerException (without a message argument).
      Since failed checks are currently reported with an IllegalArgumentException, the change is not backward-compatible.

        Attachments

          Activity

            People

            • Assignee:
              erans Gilles Sadowski
              Reporter:
              erans Gilles Sadowski
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: