Table of Contents
All PEtALS source code must respect some coding rules:
formatting rules,
naming conventions,
coding rules.
These rules are verified automatically by the tools: Checkstyle, PMD and Findbugs.
PEtALS formating rules are designed to format all the code according to the Java Sun code style recommandation with some little changes to match the PEtALS configuration of Checkstyle, PMD and Findbugs. Thess rules are the following :
class members sorting rule :
Inside a class, member must be sorted by category in the following order :
types,
static fields,
fields,
constructors
static initializers,
static methods
initializers,
methods.
Inside a category, members must be sorted by visibility in the following order :
public,
protected,
default,
private.
import statements sorting rule: they are ordered as :
java
javax
org
org.objectweb.petals
com
The binding components should be named petals-bc-*
The service engines should be named petals-se-*
A warning detected by Findbugs, that can't be fixed for a good reason, can be escaped using the following findbugs annotation: edu.umd.cs.findbugs.annotations.SuppressWarnings. More information on this annotation could be found here. The two parameters of the annotation must be provided.
To use this annotation, you must add the findbugs annotations artefact to the project POM file with a scope set to provided :
<dependencies>
...
<dependency>
<groupId>findbugs</groupId>
<artifactId>annotations</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
...
</dependencies>Next, you can add the annotation without to provide a justification, as following :
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value={"UI"}, justification="Will be never extended.")
public void setUp() {
...
}

PEtALS 2.0 & pack (2007/09/28)

