ReactFX icon indicating copy to clipboard operation
ReactFX copied to clipboard

JavaFX 19+ introduces signature issues with ReactFX

Open Symeon94 opened this issue 5 months ago • 0 comments

I'm trying to compile the code with some more recent version of JavaFX (21) and it seems that there are Java syntax problem on the master branch throughout the code.

Methods like this one are failing due compilation:

public interface Val<T>
extends ObservableValue<T>, Observable<Consumer<? super T>> {
    // ...
    default <U> Val<U> flatMap(Function<? super T, ? extends ObservableValue<U>> f) {
        return flatMap(this, f);
    }
    // ...
}

Error reported is:

'flatMap(Function<? super T, ? extends ObservableValue<U>>)' in 'org.reactfx.value.Val' clashes with 'flatMap(Function<? super T, ? extends ObservableValue<? extends U>>)' in 'javafx.beans.value.ObservableValue'; both methods have same erasure, yet neither overrides the other

It clashes with the ObservableValue from JavaFX which now has the following method signature:

    default <U> ObservableValue<U> flatMap(Function<? super T, ? extends ObservableValue<? extends U>> var1) {
        return new FlatMappedBinding(this, var1);
    }

It seems that this was modified in version 19.0.2 of JavaFX

Likely I should use version 18 which does not have the problem, but I wanted to report the issue still.

Symeon94 avatar Aug 04 '25 09:08 Symeon94