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

Wasted work in SlingServletResolver.activate()

    XMLWordPrintableJSON

Details

    Description

      The problem appears in version 6 and in revision 1495454. I attached
      a one-line patch that fixes it.

      In method "SlingServletResolver.activate", the loop over
      "executionPaths" should break immediately after "hasRoot" is set to
      "true". All the iterations after "hasRoot" is set to "true" do not
      perform any useful work, at best they just set "hasRoot" again to
      "true".

      Method "isLive" in class "ResourceResolverContext" has a similar loop
      (over "dynamicProviders"), and this loop breaks immediately after
      "result" is set to "false", just like in the proposed patch. Other
      methods (e.g., "FactoryPreconditions.checkPreconditions",
      "JspUtil.checkAttributes", "EclipseJavaCompiler.compile",
      "SecondPassVisitor.appendPageDirective") also have similar loops with
      similar breaks, just like in the proposed patch.

      Attachments

        1. patch.diff
          0.7 kB
          Adrian Nistor

        Activity

          People

            cziegeler Carsten Ziegeler
            adriannistor Adrian Nistor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: