<Swing Dev> RfR JDK-8134116, Add more comprehensive fix and regression test for JDK-8133897

Pete Brunet peter.brunet at oracle.com
Sat Oct 31 03:28:21 UTC 2015


Please review
http://cr.openjdk.java.net/~ptbrunet/JDK-8134116/webrev.03/

The only change is getTitle at line 2345.

        private String getTitle() {
            String t;
            if (component != null) {
                int i = parent.indexOfComponent(component);
                t = (i == -1) ? null : getTitleAt(i);
            } else {
                t = null;
            }
            return t;
        }

I didn't understand the comment about getAccessibleName.  I think
getAccessibleName needs to use getTitle like the rest of the code.

The regression test passes with this change.  Note that I first tried
using indexOfTabComponent as suggested but that did not work.

Pete

On 10/30/15 11:29 AM, Pete Brunet wrote:
> Thanks Sergey, I will work on a new webrev today.  -Pete
>
> On 10/28/15 12:42 PM, Sergey Bylokhov wrote:
>> Hi, Pete.
>>     I guess it will be better to don't use the title (especially
>> parent.indexOfTab(title)) at all in the our code, except the situation
>> when we should access the title(like in getAccessibleName()). All
>> other cases should be rewritten to use
>> parent.indexOfTabComponent(comp). For example your  "private String
>> getTitle() {}" can be implemented like this:
>>
>>    return getTitleAt(parent.indexOfTabComponent(comp));
>>
>> On 20.10.15 18:45, Pete Brunet wrote:
>>> Please review this patch:
>>> http://cr.openjdk.java.net/~ptbrunet/JDK-8134116/webrev.02/
>>>
>>> The issue raised/fixed in 8133897 and now resolved in a better fashion
>>> in this patch is caused by an override of the functionality of
>>> JTabbedPane such that its Page inner class title field is not kept up to
>>> date by the overriding code. When the Page title field is empty
>>> getTitleAt is now called so that the overridden getTitleAt will provide
>>> the title.
>>>
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8134116
>>>
>>> Pete
>>>
>>




More information about the swing-dev mailing list