This page contains the set of instructions needed to automatically check that your coding style conforms to the required style rules including javadoc comments. Assignments 2 and 3 require the use of javadoc @param, @return and @throw tagged comments in addition to descriptive javadoc comments.
You will need Checkstyle, which is an open-source style-checking program.
After it unzips you should have a folder called "checkstyle-3.5".
Now download RunCheck.jar (you may need to right-click to save it), which is a graphical interface to Checkstyle. Also download a2Checks (again, you may need to right-click to save it), which contains the style rules for A2.
Double-click on RunCheck.jar. It should show a window with 4
buttons across the top. Before it will work you need to tell it where your
checkstyle information is:
Select Set up file locations.
Select jar file and navigate to checkstyle-all-3.5.jar,
which is in the checkstyle-3.5 directory.
Select XML options file and navigate to
a2Checks.xml. These rules come from:
You are now ready to style-check a Java file.
Select Set up file locations.
Select Java file and pick a file.
Run CheckStyle. In several seconds you'll see the
results. You can also check your entire directory at once.
Select Set up file locations.
Select directory of files and pick the directory containing your .java files.
Run CheckStyle. The results for all of your java files in this directoy will be displayed.While this code will help eliminate style problems, it will not identify every problem. For example, it will not catch these problems:
public unless it is a helper class, in
which case it must be private.private.