Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

checkstyle rules that covers Effective Java recommendations

Does anyone know if there is a compilation of check style rules that covers most of the recommendations made by Joshua Bloch in his Effective Java book? I know I can add custom rules in the checkstyle plugin but I was wondering if anyone has already done so and if willing to share them. :)

like image 952
CoolBeans Avatar asked Nov 04 '10 20:11

CoolBeans


People also ask

What Cannot be done by Checkstyle tool?

The checks performed by Checkstyle are mainly limited to the presentation of the code. These checks do not confirm the correctness or completeness of the code.

Can Checkstyle check code layout and formatting issues?

Checkstyle can check many aspects of your source code. It can find class design problems, method design problems. It also has the ability to check code layout and formatting issues.

How do I check my Checkstyle violations?

To view to violation report, go to Window -> Show View -> Other, and search for Checkstyle. Options for Violations and Violations Chart should be displayed.


1 Answers

I am the founder of the Checkstyle project. As far as I know, no such Checkstyle rules file exists. I am not surprised as Checkstyle checks can only check source code level things, such as Javadoc comments, whitespace, etc.

Unlike FindBugs, Checkstyle does not compile the source code, and hence does not have access to type information which would be required to implement implement some of the recommendations made by Joshua Bloch in his Effective Java book.

like image 169
Oliver Avatar answered Sep 30 '22 08:09

Oliver