directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject Re: Constants static but not final
Date Mon, 17 May 2010 09:11:52 GMT
On 5/17/10 10:43 AM, Felix Knecht wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> There a multiple findings (findbugs) about static variables not being
> final, e.g. [1]:
> "MS: Field isn't final but should be (MS_SHOULD_BE_FINAL)
> A mutable static field could be changed by malicious code or by accident
> from another package. The field could be made final to avoid this
> vulnerability."
>
> I suggest setting such constants final as well.
> Are there any objections?
>    

No objection. static final is a must have.

One thing to consider though : check if Enum could be an option. It's 
probaby better in many cases (of course not for a singe value).


-- 
Regards,
Cordialement,
Emmanuel L├ęcharny
www.nextury.com



Mime
View raw message