Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-1963

Outdated JavaDoc content in MarkupContainer class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3.4
    • 1.4-RC2
    • wicket
    • None
    • Windows Environment

    Description

      In the JavaDoc of MarkupContainer, the following is not correct:

      --------------------------
      ...Children can be added by calling the add() method, and they can be looked up using a dotted path. For example, if a container called "a" held a nested container "b" which held a nested component "c", then a.get("b.c") would return the Component with id "c". ...
      ------------------

      In the code of MarkupContainer, we use Component.PATH_SEPARATOR, which is ":". The example in JavaDoc should be updated to
      use a.get("b:c") rather than a.get("b.c").
      -------------------------------------------------------------
      /**

      • Get a child component by looking it up with the given path.
      • @param path
      • Path to component
      • @return The component at the path
        */
        public final Component get(final String path)
        {
        // Reference to this container
        if (path == null || path.trim().equals("")) { return this; }

      // Get child's id, if any
      final String id = Strings.firstPathComponent(path, Component.PATH_SEPARATOR);

      // Get child by id
      Component child = children_get(id);

      // If the container is transparent, than ask its parent.
      // ParentResolver does something quite similar, but because of <head>,
      // <body>, <wicket:panel> etc. it is quite common to have transparent
      // components. Hence, this is little short cut for a tiny performance
      // optimization.
      if ((child == null) && isTransparentResolver() && (getParent() != null))

      { child = getParent().get(path); }

      // Found child?
      if (child != null)

      { final String path2 = Strings.afterFirstPathComponent(path, Component.PATH_SEPARATOR); // Recurse on latter part of path return child.get(path2); }

      return child;
      }
      --------------------------------------------------------------

      Attachments

        Activity

          People

            Unassigned Unassigned
            valentine2008 Valentine Wu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

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