Bitten by the lambda parameter name

Dan Smith daniel.smith at oracle.com
Tue Jul 16 15:17:27 PDT 2013


On Jul 16, 2013, at 3:59 PM, Remi Forax <forax at univ-mlv.fr> wrote:

>   StringBuilder builder = createText(StringBuilder.class, builder -> builder.append("name"));

Ah, interesting example.  In this case, because we're initializing the variable, the lambda parameter is initialized _first_ and capture doesn't help.  I'm more sympathetic here than I am to scenarios where, performance aside, a better API would avoid the redundancy.

—Dan


More information about the lambda-dev mailing list