Wicket
  1. Wicket
  2. WICKET-5199

Component.getBehaviors(Class<M> type) documentation is obsolete

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 6.8.0
    • Fix Version/s: 6.9.0, 7.0.0
    • Component/s: wicket
    • Labels:

      Description

      Current documentation sounds:

      /**

      • Gets the subset of the currently coupled {@link Behavior}s that are of the provided type as a
        * unmodifiable list. Returns an empty list rather than null if there are no behaviors coupled
        * to this component.
        *
        * @param type
        * The type or null for all
        * @return The subset of the currently coupled behaviors that are of the provided type as a
        * unmodifiable list or null
        * @param <M>
        * A class derived from IBehavior
        */

        As you can see, the description is inconsistent with return doc. It should be "as an unmodifiable list" instead of "as a unmodifiable list or null", because Behaviors.getBehaviors(Class<M> type) never returns null. Please notice the typo as well ("a" vs. "an").

        Moreover, the <M> param doc speaks about IBehavior, which was dropped in 1.5 (which is a pity in my opinion, but that's another thing). There should be "Behavior" instead of "IBehavior".

        So the documentation should be:
        /**
        * Gets the subset of the currently coupled {@link Behavior}

        s that are of the provided type as a

      • unmodifiable list. Returns an empty list rather than null if there are no behaviors coupled
      • to this component.
      • @param type
      • The type or null for all
      • @return The subset of the currently coupled behaviors that are of the provided type as an
      • unmodifiable list
      • @param <M>
      • A class derived from Behavior
        */

        Activity

        Hide
        Sven Meier added a comment -

        Thanks, your attention to details are appreciated!

        Show
        Sven Meier added a comment - Thanks, your attention to details are appreciated!

          People

          • Assignee:
            Sven Meier
            Reporter:
            Ota Hauptmann
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development