As an alternative to littering my code with thousands of final keywords in front of my parameters, I’m trying to enforce it using FindBugs.
It doesn’t seem possible to do this, but there should be a way, shouldn’t there?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Findbugs has one related bug pattern:
However, I don’t think this will catch instances where you overwrite the param after reading the param somewhere.
On the other hand, it looks like PMD does have a rule that is exactly what you’re looking for:
And if that doesn’t work for you, the PMD people have a list of many more static checkers, both free and commercial that you could look into.