You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sven Meier (JIRA)" <ji...@apache.org> on 2013/03/26 22:57:15 UTC

[jira] [Resolved] (WICKET-5116) TabbedPanel.setSelectedTab() does not behave as specified in JavaDoc

     [ https://issues.apache.org/jira/browse/WICKET-5116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sven Meier resolved WICKET-5116.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 6.7.0
         Assignee: Sven Meier

corrected the javadoc
                
> TabbedPanel.setSelectedTab() does not behave as specified in JavaDoc
> --------------------------------------------------------------------
>
>                 Key: WICKET-5116
>                 URL: https://issues.apache.org/jira/browse/WICKET-5116
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 6.6.0
>            Reporter: Stephan Classen
>            Assignee: Sven Meier
>             Fix For: 6.7.0
>
>
> The JavaDoc of TabbedPanel.setSelectedTab() states that -1 is a valid argument. Actually passing -1 will throw a IndexOutOfBoundsException
> {code}
> 	/**
> 	 * sets the selected tab
> 	 * 
> 	 * @param index
> 	 *            index of the tab to select
> 	 * @return this for chaining
> 	 * @throws IndexOutOfBoundsException
> 	 *             if index is not {@code -1} or in the range of available tabs
> 	 */
> 	public TabbedPanel<T> setSelectedTab(final int index)
> 	{
> 		if ((index < 0) || (index >= tabs.size()))
> 		{
> 			throw new IndexOutOfBoundsException();
> 		}
> 		setDefaultModelObject(index);
> 		// force the tab's component to be aquired again if already the current tab
> 		currentTab = -1;
> 		setCurrentTab(index);
> 		return this;
> 	}
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira