Bitten by the lambda parameter name
Remi Forax
forax at univ-mlv.fr
Tue Jul 16 15:59:51 PDT 2013
On 07/17/2013 12:40 AM, maurizio cimadamore wrote:
> On 16-Jul-13 11:17 PM, Dan Smith wrote:
>> > StringBuilder builder = createText(StringBuilder.class, builder
>> -> builder.append("name"));
> What is this meant to replace exactly? It's a shorthand for:
>
> StringBuilder builder = new StringBuilder();
> builder.append("name");
>
> ?
>
> Maurizio
Again, I'm not sure why this is interesting to know exactly what the
code does,
Anyway, the code of createText allows you to create a mutable object by
reflection, to initialize it and when you get the result,
you have the guarantee that you can never see the object half initialized.
Rémi
More information about the lambda-dev
mailing list