I use tool to check coding style and I got hundreds of this advise :
Local variable 'XXX' could be declared final
Here is some of my code:
//Local variable 'cookies' could be declared final
Cookie[] cookies = request.getCookies();
//Local variable 'cookie' could be declared final
if (cookies != null) {
for (Cookie cookie : cookies) {
}
}
//Local variable 'qry' could be declared final
StringBuffer qry = new StringBuffer("from User u where u.account=? ");
Is it means I should use final
like
final Cookie[] cookies = request.getCookies();