[External] : Re: crazy idea: weaken the effectively final restriction

Alan Snyder javalists at cbfiddle.com
Wed Oct 6 21:50:46 UTC 2021


I was referring to the the example in *your* message, which does not have multiple assignments.

Runnable f(String s) {
              s = normalize(s);
              return () -> println(s); // no can do: s is not effectively final
}

Seems pretty clear to me.



> On Oct 6, 2021, at 12:04 PM, John Rose <john.r.rose at oracle.com> wrote:
> 
> 
> On Oct 6, 2021, at 11:30 AM, Alan Snyder <javalists at cbfiddle.com<mailto:javalists at cbfiddle.com>> wrote:
> 
> But I don’t see any problem reading and understanding the original code.
> 
> You prove my point.  Problems you (as maintainer) don’t see can
> be the hardest kind of problem to deal with, right?
> 
> What problem do you think the maintainer will have with the original code?
> 
> I’m referring to problem already mentioned on this thread,
> notably confusion among multiple values of a variable
> which is multiply assigned.
> 



More information about the jdk-dev mailing list