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

StringIndexOutOfBoundsException from resolver.map with non absolute path

    XMLWordPrintableJSON

Details

    Description

      ResourceResolver.map("content/we-retail/us/en”) - Forward Mapping

      Steps to Reproduce : 

      1. go to /system/console/jcrresolver console
      2. input "content/we-retail/us/en" in Test
      3. click map

      Output 
      it give out the error message -: java.lang.StringIndexOutOfBoundsException: String index out of range: -1

       

      https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/master/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java#L770

      final String pathInfo = absPath.substring(path.length());

      path = "/content/we-retail/us/en" whereas absPath = "content/we-retail/us/en"   .... substring fails

       

      Attachments

        1. StringIndexOutofBounds.patch
          1 kB
          Ashok Kumar

        Issue Links

          Activity

            People

              karlpauls Karl Pauls
              ashokpanghal Ashok Kumar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h