[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: RFR: JDK-6998249: Wrong behavior/Javadoc of JTable.tableChanged(TableModelEvent e)
From:       Phil Race <prr () openjdk ! java ! net>
Date:       2022-01-28 22:22:09
Message-ID: CStwx1L7kMrvWX6IM9PVwq6ZKM-GSgCeeYs49rJrvuI=.3d7c06a5-4c6c-4d91-8763-a6323031a65e () github ! com
[Download RAW message or body]

On Fri, 28 Jan 2022 20:03:10 GMT, Harshitha Onkar <duke@openjdk.java.net> wrote:

> > I said most of the doc is changing which is clearly not most of the doc for \
> > JTable so it means just this method. 
> > To the latter point the doc you are proposing is asserting that it does not apply \
> > to rows. Now since we also know this is all supposed to be code called ny the \
> > implementation and responded to by the implementation and even so we are NOT \
> > going to change anything because some code somewhere would break, nontheless we \
> > want to be sure the new code is what actually happens and not just what someone \
> > wrote in a  bug report several years ago. So go find the code that calls "new \
> > TableModelEvent" and point in this PR to how it guarantees the rows are in view \
> > order.
> 
> @prrace After going through the code, I see that the `new TableModelEvent()` is \
> called in setModel of JTable but I wasn't able to locate the code that does \
> model-to-view coordinate mapping for rows from here. Within the `tableChanged` \
> method I see `sortedTableChanged` method being called if ` sortManager != null ` \
> which in turn calls `convertRowIndexToView` method (which is called when either \
> sorter or model changes and sorting is enabled). I think this is the method that is \
> responsible for mapping coordinate system from model to view for the rows.

I was just looking at this same code too - and that's how it looks to me.
So the claim in the report AND the evaluation both look wrong to me.
But verify this with testing. I am not sure but it seems like merely doing whatever \
it is to install a RowSorter will ttigger that code path and the code the submitter \
pointed to is only used if the model row == the view row ..

-------------

PR: https://git.openjdk.java.net/jdk/pull/7253


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic