Effectively final effective?

Neal Gafter neal at gafter.com
Wed Feb 24 14:49:04 PST 2010


On Wed, Feb 24, 2010 at 2:12 PM, Joshua Bloch <jjb at google.com> wrote:
>> I'd argue that adding the keyword is no more or less difficult than it was
>> when inner classes were introduced, and that modern IDEs will automatically
>> prompt you to change the variable to final with a single click if used in an
>> inner class.
>
> I agree, but most people hate this aspect of anonymous classes, and we can
> fix it. It's vaguely analogous to what we're doing with the "diamond
> operator" (<>) for parametrized type instance creation.

It isn't just the visual noise that people find so bothersome.  The
restriction itself is also bothersome, and harder to work around.


More information about the lambda-dev mailing list