Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-909

JcrResourceResolver2.resolve returns null for non-existing resources while api doc says otherwise

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • JCR Resource 2.0.2
    • JCR Resource 2.0.4
    • JCR
    • None

    Description

      (This is a basically a re-opening of SLING-752, because I don't have rights to reopen that bug).

      In current trunk, although to be said to be fixed with SLING-752, the API doc of ResourceResolver.resolve(String) says:

      • @return The {@link Resource}

        addressed by the <code>absPath</code> or a

      • {@link NonExistingResource}

        if no such resource can be resolved.

      The implementation of this method in JcrResourceResolver2 however will return null (it calls resolveInternal() with requireResource=false).

      I have a use case where I don't have a request object (running in an event job) but still like to get a NonExistingResource, not null. Therefore I'd suggest to change JcrResourceResolver2.resolve() to not return null (and keep the javadoc).

      Attachments

        Activity

          People

            fmeschbe Felix Meschberger
            alexander.klimetschek Alexander Klimetschek
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: