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

IRequestableComponent getPage() javaDoc and Component implementation mismatch

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 6.25.0, 8.0.0
    • 7.6.0, 8.0.0-M3
    • wicket
    • None

    Description

      The

      https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/request/component/IRequestableComponent.java

      does tell in its javaDoc that getPage() may return null.

      	/**
      	 * Returns page this component belongs to.
      	 * 
      	 * @return page instance or <code>null</code>
      	 */
      IRequestablePage getPage();
      

      Looking at the implementor

      https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/Component.java

      it does throw a WicketRuntimeException if it is null.
      Looking at e.g. createRequestHandler(...) it does not check if its null either.

      So are implementors allowed to return null here or is the javaDoc on the interface obsolete?

      Attachments

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            tkrah Torsten Krah
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: