Yes, or given the background of the language designers, CPA. And the compiler has to figure this out in order to give the error message -- and even in the error case, there are several trivial ways to transform the code to be equivalent. (It's a mite more difficult to make sure debuggers know what to do, but also a long-solved problem).
So I'm baffled why we are required to write 'final' in this one case. At first, when Java first came out, I assumed it was a time-to-market thing. It's not fatal -- it just means more chances to screw up when we humans do the compiler's work for it. On Jan 29, 5:10 pm, fadden <[email protected]> wrote: > Variables that don't change can be given special treatment. However, > any compiler worthy of the name will figure this out automatically -- > it's one of the things that falls out of SSA form (see > e.g.http://en.wikipedia.org/wiki/Static_single_assignment_form). > Explicitly labeling a local variable as "final" isn't necessary, > because any compiler sophisticated enough to make use of that fact > should also be sophisticated enough to figure it out for itself. > > Using final on classes, methods, and fields is more interesting. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

