resources.report.rules.pmd.GenericsNaming.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sanity4j Show documentation
Show all versions of sanity4j Show documentation
Sanity4J was created to simplify running multiple static code
analysis tools on the Java projects. It provides a single entry
point to run all the selected tools and produce a consolidated
report, which presents all findings in an easily accessible
manner.
The newest version!
GenericsNaming
GenericsNaming
Names for references to generic values should be limited to a single uppercase letter.
//TypeDeclaration/ClassOrInterfaceDeclaration/TypeParameters/TypeParameter[
string-length(@Image) > 1
or
string:upper-case(@Image) != @Image
]
Example(s):
public interface GenericDao<E extends BaseModel, K extends Serializable> extends BaseDao {
// This is ok...
}
public interface GenericDao<E extends BaseModel, K extends Serializable> {
// Also this
}
public interface GenericDao<e extends BaseModel, K extends Serializable> {
// 'e' should be an 'E'
}
public interface GenericDao<EF extends BaseModel, K extends Serializable> {
// 'EF' is not ok.
}