Unexpected variable ... is already defined ...
Denis DEBARBIEUX
denis.debarbieux at inria.fr
Wed Dec 26 06:13:58 PST 2012
>> If yes, can the inner function (that does the test) use the outer
>> parameter event?
> yes, you can capture the value of parameters and local variables if they
> are effectively final (not assigned more than once).
Thanks for your help.
How can you set that the value of a parameter is /final/?
/getStream().map(//final//event -> event.matchIfA(//_event//->
"a".equals(//_event//.label))).forEach(System.out::println);/
does not compile.
According to my tests, they are not final by default.
Denis
More information about the lambda-dev
mailing list