On Tue, Nov 15, 2016 at 2:51 PM, Emond Papegaaij <emond.papega...@topicus.nl
> wrote:

> It seems I've hit a bug in javac:
> LambdaModelTest[46,61] reference to of is ambiguous:
> <T>   of(SerializableSupplier<T>, SerializableConsumer<T>)
> <X,T> of(IModel<X>,               SerializableFunction<X,T>)
>
> This clearly is wrong:
> IModel<String> personNameModel = LambdaModel.of(
>     () -> person.getName(),
>     (name) -> person.setName(name));
>
> The first parameter could match both SerializableSupplier<T> and IModel<X>,
> but the second parameter only matches SerializableConsumer<T>. Eclipse has
> no
> problem with this and compiles the code just fine.
>

I guess it confuses it with SerializableFunction<String, Void>. Although, I
agree it should return null to actually match.

IMO we don't
need org.apache.wicket.model.LambdaModel#of(org.apache.wicket.model.IModel<X>,
org.danekja.java.util.function.serializable.SerializableFunction<X,T>)
It gives the same
as org.apache.wicket.model.IModel#map(SerializableFunction<? super T, R>
mapper).


>
> This now surfaces due to the change in the constructor. This testcase used
> to
> call new LambdaModel(...), which had the same signature as the first 'of'.
> I
> had to change it to use the overloaded factory method.
>
> I see two possible solutions:
>  - Change the name of the factory methodes, so they are no longer
> overloaded
> (suggestions for the names are welcome)
>  - Add a cast to the calling code to circumvent the bug.
>
> IMHO both are ugly.
>
> Best regards,
> Emond
>
> On dinsdag 15 november 2016 13:36:56 CET build...@apache.org wrote:
> > The Buildbot has detected a new failure on builder wicket-master while
> > building wicket. Full details are available at:
> > https://ci.apache.org/builders/wicket-master/builds/550
> >
> > Buildbot URL: https://ci.apache.org/
> >
> > Buildslave for this Build: bb_slave1_ubuntu
> >
> > Build Reason: The SingleBranchScheduler scheduler named
> > 'on-wicket-master-commit' triggered this build Build Source Stamp:
> [branch
> > master] b40e9e1cd9ad7a9ffc63ab6c329c8d9c8b78b924 Blamelist: Emond
> Papegaaij
> > <papega...@apache.org>
> >
> > BUILD FAILED: failed compile
> >
> > Sincerely,
> >  -The Buildbot
>
>
>

Reply via email to