The fix looks good to me.

Thanks,
Alexandr.

On 12/8/2015 11:04 PM, Semyon Sadetsky wrote:


On 12/8/2015 10:56 PM, Sergey Bylokhov wrote:
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.
There are DefaultRowSorter usage in the FilePane that relays on the current logic, but the current logic doesn't work for JTable sorting. (Remind you that the initial problem was 6894632). The first solution worked in both cases, but it had caused Alexanders doubts in offline discussion. The second version fixes the FilePane and doesn't use the ambiguous Math.max.
For me both are working solutions.


  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









Reply via email to