All Downloads are FREE. Search and download functionalities are using the official Maven repository.

resources.report.rules.pmd.GenericsNaming.html Maven / Gradle / Ivy

Go to download

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.
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy