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

Change TreeLocation.getChild() to only accept direct child nodes (not relative paths)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.7
    • core
    • None

    Description

      As mentioned on the list [1] resolving relative paths in TreeLocation.getChild() is expensive. Since not all clients need this functionality but all inherit the additional performance penalty, I suggest to remove support for relative paths and move that functionality into a helper class (e.g. LocationHelper).

           /**
      -     * Navigate to a child through a relative path. A relative path consists of a
      -     * possibly empty lists of names separated by forward slashes.
      -     * @param relPath  relative path to the child
      +     * Navigate to a child of the given {@code name}.
      +     * @param name  name of the child
            * @return  a {@code TreeLocation} for a child with the given {@code name}.
            */
           @Nonnull
      -    TreeLocation getChild(String relPath);
      +    TreeLocation getChild(String name);
      

      [1] http://markmail.org/message/o72qikdvyr5xyxfu

      Attachments

        1. OAK-732.patch
          28 kB
          Michael Dürig

        Issue Links

          Activity

            People

              mduerig Michael Dürig
              mduerig Michael Dürig
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: