Apologies my intentions were not clear.

Final variables == good
Final classes == bad

On Dec 9, 2008, at 1:40 PM, Rodrigo Gallardo wrote:

On Tue, Dec 09, 2008 at 01:20:27PM -0800, Paul Lindner wrote:

On Dec 8, 2008, at 9:36 AM, Henning P. Schmiedehausen wrote:

Paul Lindner <[EMAIL PROTECTED]> writes:

The error string was generated for every single field when
serializing
an object.  So if you have the person object with say 10 fields you
generate 10 error message strings.  That's a lot of Strings!

Yes, that is obvious. I was wondering about the final modifiers
because this is how I tend to write code and a while back, a number of my patches were shot down because "this does not adhere to the rest of
the shindig code". If we start changing this, that is better.

[...]

actually:

http://cwiki.apache.org/SHINDIGxSITE/java-style.html


final
Use final whenever possible on all member variables.

Reasoning: Avoids missing initialization.

However, since this is a library I would not make anything but static
inner classes final.

Sorry, I don't see how that follows. final, when applied to classes
and methods means 'not overridable by inheritance'. When applied to
variables means 'can only be assigned once'. Yes, I agree that classes
and methods in a library should be inheritable from, but I fail to see
how member variables have much to do with that.

And making variables final also helps (lots) with thread safety, which
is an importatn concern.

Paul Lindner
[EMAIL PROTECTED]



Reply via email to