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

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

Stephan Classen created WICKET-5116:
---------------------------------------

             Summary: 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


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