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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 6.8.0
    • 6.9.0, 7.0.0-M1
    • wicket

    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
        */

      Attachments

        Activity

          People

            svenmeier Sven Meier
            otah Ota Hauptmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: