Here is a really good write up that I subscribe to that in addition to the
'Final fields' section has some really good links to other 'field' related
resources.
http://www.ibm.com/developerworks/java/library/j-jtp1029/index.html
I have also based my use of final fields on the exposure of
Oops, sorry completely misread your question - The answer is almost the same
the though. I have avoided subtle bugs by using 'this'
I guess that 'this' is more for readability. I'll stop doing it on OpenEJB
code if it is considered overkill.
Andy.
--
View this message in context:
hmm,
didn't find mention of this usage in this doc
maybe i was not clear so trying to be a bit more: updating code to use
final is IMO a nice update. The update i don't get is why replacing
foo() by this.foo(). If the call is ambiguous it is a bad practice
and if it is not it makes code a bit
I guess the most obvious subtle bug avoided by 'this' that I can think of is
the use of same named method and field variables, often in abstract classes.
I have seen the the 'super' being set where the 'this' was intended, and
vice versa.
--
View this message in context:
well it sound like a design bug for me, but once again, i'll not
revert such a commit ;). Was just curious cause i usually try to avoid
this usage.
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github:
On Dec 11, 2012, at 2:52 AM, AndyG andy.gumbre...@orprovision.com wrote:
If I have my way I would prefer a 'mutable' keyword, with the default being
'immutable' (final) ;-).
Man after my own heart :)
http://blog.dblevins.com/2011/04/final-is-my-favorit-java-keyword.html
An update to that