source code my one of JavaWorld articles "Automated code reviews with Checkstyle, Part 1" (http://www.javaworld.com/javaworld/jw-11-2008/jw-11-checkstyle1.html)
Java Batchfile Shell
Switch branches/tags
Nothing to show
Permalink
Failed to load latest commit information.
lib first commit May 14, 2012
samples first commit May 14, 2012
src/main/java/com/shri/article/checkstyle
.classpath first commit May 14, 2012
.gitignore first commit May 14, 2012
.project first commit May 14, 2012
README.md
build.bat first commit May 14, 2012
build.properties
build.xml first commit May 14, 2012
custom_check.xml first commit May 14, 2012
pom.xml first commit May 14, 2012
run.bat first commit May 14, 2012
run.sh first commit May 14, 2012

README.md

#Checkstyle Samples application

In this application a lot of custom Checkstyle rules have been created. For some, test conditions have been prepared. This document provides the details about them and also on how to run them.

for testing purposes

##Build To build the application simply run build.bat on Windows platform or run build.sh on UNIX/LINUX platform. You need to have ANT available to build the application. As part of build, it will create classes in bin directory and will create a Jar file inside target directory.

##Run the samples

Please note to run the below mentioned checks, please comment other Checks in the custom_check.xml and uncomment the one you want to execute.

###MethodCallWithoutObjectCreation Check This Check provides the instances where a method has been called on an uninitialized variable. To run the test condition use: run.bat samples\InterfaceServiceImpl.java

###MethodLimitCheck Check This Check checks the number of methods inside a class. If it exceeds from a pre-determined number, it gives the error. To run the test condition use: run.bat samples\Test.java

###TraceMessagesCheck Check This Check checks if for a specific pattern of classes, trace messages for method enter and exit are there or not. To run the test condition use: run.bat samples\TraceEnterSample.java

###NoStateVariables Check This Check validates if a pattern of classes contains state variables when those classes are supposed to be stateless. To run the test condition use: run.bat samples\SingletonSample.java

###IllegalMethodCallInLoopCheck Check This Check checks if a method call has been used in a loop condition. To run the test condition use: run.bat samples\SingletonSample.java

###IllegalExceptionCatchCheck and IllegalExceptionThrowsCheck Check These two checks focuses on catching instances where something illegal exception type is caught or thrown in methods. To run the test conditions use: run.bat samples\Test.java