Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsfeed.datemas.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: markspace Newsgroups: comp.lang.java.programmer Subject: Re: Assumed final? Date: Mon, 30 Jun 2014 11:25:33 -0700 Organization: A noiseless patient Spider Lines: 14 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 30 Jun 2014 18:25:36 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="9358cda03e1e0dfd3c4b757daa608707"; logging-data="10609"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+YepNYO9aaPeW78bWbBeDI6M8G55qnjuc=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Cancel-Lock: sha1:WLiG1CKyl6OrBq4hKwUZOsts83w= Xref: csiph.com comp.lang.java.programmer:28879 On 6/30/2014 10:28 AM, Knute Johnson wrote: > So it appears that the Java 8 compiler has gotten smarter or I haven't > been paying enough attention :-). > Gotten smarter, I think. This was added for Java 8 lambdas. So now instead of having to declare you variables final for anonymous inner classes/lambdas, the compiler can figure out if it is "effectively final" (note the text of your error message) and just assume you meant "final". Handy for lambdas because it makes them less verbose in some situations and a bit more like their aged cousins, closures.