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

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.7
    • Component/s: core
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: