[ 
https://issues.apache.org/jira/browse/WICKET-6271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15643834#comment-15643834
 ] 

Martin Grigorov commented on WICKET-6271:
-----------------------------------------

The behavior is:
- #getPage() throws exception.
- #findPage() returns null.

We will improve the docs and the calls where there is no check! Thanks!

> IRequestableComponent getPage() javaDoc and Component implementation mismatch
> -----------------------------------------------------------------------------
>
>                 Key: WICKET-6271
>                 URL: https://issues.apache.org/jira/browse/WICKET-6271
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.25.0, 8.0.0
>            Reporter: Torsten Krah
>            Priority: Minor
>
> 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.
> {code}
>       /**
>        * Returns page this component belongs to.
>        * 
>        * @return page instance or <code>null</code>
>        */
> IRequestablePage getPage();
> {code}
> 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?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to