[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: New package structure
timfox
do-not-reply at jboss.com
Wed Feb 27 07:47:42 EST 2008
Another thing is use of private final fields, and variable modifiers.
I've seen (and corrected) a lot of places where just package protected visibility was used for no obvious reason.
In most cases fields should be private, and if they're not changed after construction they should be made final too. This helps catch programming errors and also hints to the compiler to make optimisations.
Similarly we should make method/compiler params final too. This also helps to catch errors at compile time.
I've already applied this to most classes (and incidentally caught a couple of bugs doing so that only showed up after adding the final modifier :), but we should take care to do this in the future.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4132485#4132485
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4132485
More information about the jboss-dev-forums
mailing list