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.