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

Oak UserManager#getAuthorizable handles null and empty string differently than Jackrabbit

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.3.2
    • 1.3.4, 1.4
    • core
    • None

    Description

      With Jackrabbit, the following API call

      UserManager#getAuthorizable(String auth)
      

      with either null or "" used to throw

      throw new IllegalArgumentException("Invalid authorizable name '" + id + "'");
      

      With Oak UserManager, the same input does not throw an IAE, but instead return a null value when providing "" and throws a NPE when providing null.

      From my POV, it would be best to avoid throwing exceptions on those two cases. Indeed, returning a null value is simpler for the API user and would comply with the API.
      If so, the implementation in case of null may be changed in order to swallow the null value and the difference between Jackrabbit and Oak may be documented.

      Attachments

        1. OAK-3191_2.patch
          11 kB
          Angela Schreiber
        2. OAK-3191.patch
          10 kB
          Angela Schreiber
        3. OAK-3191.patch
          2 kB
          Timothee Maret

        Activity

          People

            angela Angela Schreiber
            marett Timothee Maret
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: