[API Review] Property and expression conversion methods

Knut Arne Vedaa knut.arne.vedaa at broadpark.no
Mon Feb 18 13:39:22 PST 2013


Martin Sladecek wrote:
> Hello,
>
> there are 2 JIRA issues requesting some conversion between primitive
> expression/properties/observablevalues and theirs object counterparts,
> as primitive types actually use Number as generics parameter. To avoid
> backwards incompatibility by changing the generics parameters to more
> specific types, we decided to introduce conversion methods to these
> types, so that you can use them as objects of the same (generics) type.
>
> Here are the JIRA issues:
> http://javafx-jira.kenai.com/browse/RT-25996
> http://javafx-jira.kenai.com/browse/RT-19020

It seems to me that the root problem here is this:

interface ObservableNumberValue extends ObservableValue<java.lang.Number>

interface ObservableIntegerValue extends ObservableNumberValue

Wouldn't it be solved by changing it to:

interface ObservableNumberValue<T extends java.lang.Number> extends 
ObservableValue<T>

interface ObservableIntegerValue extends ObservableNumberValue<Integer>

(And similar for other Number descendants.)


Knut Arne Vedaa


More information about the openjfx-dev mailing list