Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9801

Many SessionImpl operations just log a NPE if null values provided

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.44.0
    • jcr
    • None

    Description

      Many operations of SessionImpl require non-null parameters and ensure this by using the checkNotNull method of Google Commons.

      If actually provided a null value, it can look like this:

      org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught Throwable
      java.lang.NullPointerException: null
          at org.apache.jackrabbit.oak.jcr.session.SessionImpl.getNamespaceURI(SessionImpl.java:788) [org.apache.jackrabbit.oak-jcr:1.42.0]
      

      This NPE because of the failed validation is non-distinguishable from a "regular" NPE. We should use the version of checkNotNull which allows to provide an error string to indicate that the parameter validation failed.

      Attachments

        Issue Links

          Activity

            People

              joerghoh Joerg Hoh
              joerghoh Joerg Hoh
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: