ContractChecker is a small tool to provide support for some design by contract features to standard Java code.

The tool includes an Ant task, which delegates the process to a Doclet. Such Doclet generates AspectJ code to intercept all method calls explicitly guarded with ContractChecker's Javadoc tags. Finally, the Ant task compiles everything using AspectJ's compiler.


ContractChecker 's stable release has reached version 0.4.5 .

The main visible improvements have to do with the Javadoc -> Qdox migration, and support for violation exception declarations.


$Date: 2004/01/11 19:44:06 $ Resolved functional requirements for version 0.4.5 : violationexception can now be specified in the Ant script.
2004/01/11 14:51:32 Functional requirements for version 0.4.5 specified in Bugzilla: # 84 , # 85 , # 86 , and # 87 .
2004/01/11 14:12:01 Merged branch contractchecker-qdox-0_4 , reaching version 0.4 .
2004/01/11 13:08:48 Completed branch ( contractchecker-qdox-0_3 ), reaching version contractchecker-qdox-0_4 .

The Qdox-version of the doclet has been tested with successful results.
2004/01/10 13:34:20 Started a branch ( contractchecker-qdox-0_3 ) to migrate the Doclet logic to Qdox .

The main advantages are:
  • Improved performance,
  • Undesired Javadoc output messages don't appear anymore,
  • Removed dependency on a non-free software library,
2003/12/28 12:42:45

ContractChecker 0.3 fulfills the initial requirements of the project: support for preconditions.

With ContractChecker 0.3 , you can just write a

followed by Java code, in the Javadoc description of any method, and ContractChecker will ensure no client code will be able to call your method incorrectly.

Here is one of the key points. Generated aspects intercept guarded method's calls , and are able to throw exceptions if the conditions are not respected. Such conditions are thrown on the client code , so their stack trace makes clear which is the responsible of the exception.

2003/12/27 23:21:25 Updated Maven documentation for 0.3 .
2003/12/26 20:12:33 Finished the minimal functional requirements to reach version 0.3 .