André Rouél and I startet a new OpenSource project to avoid technical errors in Java applications: Quality-Check.
The package quality-check tries to replace these libraries and provide all the basic code quality checks.
Example
/**
* Sets the given object if it is not null.
*
* @throws IllegalArgumentException
* if the given argument is {@code null}
*/
public void setObject(final Object object) {
if (object != null) {
throw new IllegalArgumentException("Argument 'object' must not be null.");
}
this.object = object;
}
can be replaces by:
/**
* Sets the given object if it is not null.
*/
@ArgumentsChecked
public void setObject(final Object object) {
this.object = Check.notNull(object);
}
It is now available in
Maven Central so adding it to your project is as simple as putting these five lines into your pom.xml:
<dependency>
<groupid>net.sf.qualitycheck</groupid>
<artifactid>quality-check</artifactid>
<version>0.9</version>
</dependency>