It seems that there still is the case when tab titles are empty string, tab components are null, components are not null and the correct index should be returned for the given page.

May be it is better to replace searching the page index by tab component to by component?
We already do this in the getTitle() method.

Thanks,
Alexandr.

On 12/01/16 01:47, Pete Brunet wrote:
Please review this patch:

http://cr.openjdk.java.net/~ptbrunet/JDK-8145735/webrev.00/

The issue being resolved is that the JTabbedPane code can't solely rely
on tabComponent when fetching the index in the parent component.
tabComponent is optionally used and its presence indicates that the
associated Component will render the tab title; otherwise the
JTabbedPane tab will.  In those cases where tabComponent is used, if it
is null then the tab's title must be used when determining the index in
parent, i.e. parent.indexofTab(getTitle()) vs
parent.indexOfTabComponent(tabComponent).

The regression test was improved to catch the cases where the fix to
JTabbedPane was not applied.  The regression test was also changed so
the exception message is more cleanly displayed when the test fails.

Reply via email to