richard.bair at oracle.com
Thu Mar 20 20:00:58 UTC 2014
InvalidationListener has one param, ChangeListener has 3. So the arity of the lambda tells the compiler which kind to produce. If there was ambiguity, the compiler would complain.
On Mar 20, 2014, at 12:54 PM, Scott Palmer <swpalmer at gmail.com> wrote:
> So I'm looking at Java 8 stuff now and I see that addListener has
> methods. One takes a ChangeListener, the other an
> So what does this do:
> Node n = getSomeNode();
> n.managedProperty().addListener(x -> test(x));
> Well it seems it adds an InvalidationListener.
> So I tried this:
> n.managedProperty().<ChangeListener>addListener(x -> test(x));
> which seems to be accepted syntax, but it still adds an InvalidationListener !!!
> Help Please.
> Why didn't JavaFX 8 add two new methods:
More information about the openjfx-dev