Just to *wrap up* this thread: *I'm with-drawing my proposal.* We do not have any sort of consensus (rough or otherwise) regarding the use of final on local variables.
Thanks to everyone who participated! On Thu, Jun 13, 2019 at 1:31 PM Kirk Lund <kl...@apache.org> wrote: > According to Effective Java 3rd Edition, all local variables are > implicitly made final by the JVM (and thus receiving the same JVM > optimizations as a final variable) without requiring use of the keyword > as long as you only set the value once. So this becomes an unnecessary use > of the keyword final which really just adds noise to the code (one more > word on many lines) much like unnecessary uses of this. on references to > class fields. The only context where it's still valuable to use final is > on class fields and constants where it provides concurrency guarantees. > > It may be useful to temporarily mark a local variable as final while > performing a refactoring. See Martin Fowler's book for various refactorings > in which he does this. > > There really is no value in retaining the keyword on a local variable any > longer, so I think we should avoid using it in the same way we avoid > unnecessary uses of this. on references to class fields. It's all just > more noise in the code. > >