TableCell.getTableRow() return value

Jonathan Giles jonathan.giles at oracle.com
Wed Nov 25 20:37:23 UTC 2015


I think in this situation you're right - I just made the change locally 
and did a full build of the SDK and all apps, and everything compiles. 
My Jira-foo is not strong enough to find the issue I'm thinking of, but 
I do recall an issue in one place in the TableView API about generics 
being added and it breaking something. I wish I could find it - I'll 
keep looking in any case.

I will file a new JBS issue and will propose this change. We can try to 
put it into JDK 9 and give it time to bake, and see if anyone comes 
forward due to being broken by it...

-- Jonathan

On 26/11/15 6:46 AM, Richard Bair wrote:
> You should be able to add generics compatibly, you just can't change the generics signature. One shot to get it right IIRC.
>
>> On Nov 25, 2015, at 8:57 AM, Jonathan Giles <jonathan.giles at oracle.com> wrote:
>>
>> It was an oversight at the time, and (from memory) is now a breaking change to fix it, so for now it remains as it is, sadly.
>>
>> -- Jonathan
>> Sent from a touch device. Please excuse my brevity.
>>
>>> On 26 November 2015 03:33:04 GMT+13:00, Lawrence Parker <larry at answerrocket.com> wrote:
>>> Seems like getTableRow() should return TableRow<S> instead of just
>>> TableRow.  That way I wouldn’t have to cast getItem().
>>>
>>>     https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/TableCell.html
>>> <https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/TableCell.html>
>>>
>>>
>>>
>>>
>>>    @Override
>>>    public void updateItem(Boolean isEnabled, boolean empty) {
>>> ...
>>>        TestCase testCase = (TestCase)getTableRow().getItem();
>>>
>>> This would be nicer:
>>>
>>>        TestCase testCase = getTableRow().getItem();
>>>
>>> Seems like an easy change to the getTableRow() method:
>>>
>>> public class TableCell<S,T> extends IndexedCell<T> {
>>> ...
>>>    public final TableRow getTableRow() { return tableRow.get(); }
>>>
>>>
>>> Was this an oversight, or is there a reason that getTableRow() needs to
>>> return TableRow instead of TableRow<S>?
>>>
>>> Thanks for any help.
>>>
>>> -Larry



More information about the openjfx-dev mailing list