<Swing Dev> [9] Review Request for 8078514: Nightly: api/javax_swing/DefaultRowSorter/index_ModelStructChanged failure

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Tue Dec 8 19:56:12 UTC 2015


On 02/11/15 16:51, Semyon Sadetsky wrote:
> On 5/26/2015 1:38 PM, Alexander Scherbatiy wrote:
>> On 5/21/2015 5:34 PM, Semyon Sadetsky wrote:
>>> Hello,
>>>
>>> I have decided to remake the fix.
>>> The reason for that is sun.swing.FilePane class. One of its inner
>>> classes extends DefaultRowSorter and relays on lazy initialization of
>>> the DefaultRowSorter in unsorted state. After removing the lazy init
>>> the FilePane crashes with AOB exception.
>>
>>    It looks like FilePane tries to call some operations like
>> DefaultRowSorter.convertRowIndexToView(int) on non updated
>> DefaultRowSorter.
>>    Is it possible to fix it in FilePane?
> I fixed the FilePane. Please review the updated webrev:
> http://cr.openjdk.java.net/~ssadetsky/8078514/webrev.02/

Can you please clarify the change from v01->v02 related to 
modelRowCount. One fix version uses Math.max, latest version skip it. 
but getViewRowCount() still use Math.max.

>>
>>   Thanks,
>>   Alexandr.
>>
>>> This can be fixed, but I think it will be too big change for the
>>> issue and users can be already using the DefaultRowSorter in the
>>> similar way.
>>> Here is the new approach:
>>> http://cr.openjdk.java.net/~ssadetsky/8078514/webrev.01/
>>> It looks a little bit risky ,but all related tests have been passed.
>>>
>>> --Semyon
>>>
>>> On 5/19/2015 2:03 PM, Alexander Scherbatiy wrote:
>>>> On 5/15/2015 5:49 PM, Semyon Sadetsky wrote:
>>>>> Hello,
>>>>>
>>>>> Please review fix for JDK9:
>>>>>
>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8078514
>>>>> webrev: http://cr.openjdk.java.net/~ssadetsky/8078514/webrev.00/
>>>>
>>>>   DefaultRowSorter
>>>> 221             allChanged();
>>>> 222             modelRowCount = getModelWrapper().getRowCount();
>>>>
>>>> - This can be moved to a private method that will be used both in
>>>> the public modelStructureChanged() and setModelWrapper() methods.
>>>>
>>>> 532     public void sort()
>>>> - Could the rawFilter be null in case viewToModel != null an
>>>> !isUnsorted() ?
>>>> - isUnsorted() method is called twice. Is it possible to store its
>>>> value to a variable and use it?
>>>>
>>>> Thanks,
>>>> Alexandr.
>>>>
>>>>>
>>>>> The 6894632 fix violated a contract between the table and its row
>>>>> sorter: the sorter should receive TableChanged events even if table
>>>>> is not sorted actually.
>>>>> Another way to fix 6894632 is to initialize sorter internal
>>>>> structures instantly. The last is applied in the fix.
>>>>>
>>>>> --Semyon
>>>>>
>>>>
>>>
>>
>


-- 
Best regards, Sergey.



More information about the swing-dev mailing list