Package net.sourceforge.pmd.lang.java.rule.codestyle
package net.sourceforge.pmd.lang.java.rule.codestyle
-
ClassDescriptionThis rule detects non-static classes with no constructors; requiring even the default constructor to be explicit.Configurable naming conventions for type declarations.Check for Methods, Fields and Nested Classes that have a default access modifier This rule ignores all nodes annotated with @VisibleForTesting by default.
if (x !
Detects fields that are declared after methods, constructors, etc.Configurable naming conventions for field declarations.Enforces a naming convention for lambda and method parameters.Flags identical catch branches, which can be collapsed into a multi-catch.Enforces a naming convention for local variables and other locally scoped variables.Checks for variables in methods that are defined before they are really needed.Detects casts where the operand is already a subtype of the context type, or may be converted to it implicitly.This rule detects when a constructor is not necessary; i.e., when there is only one constructor, it’s public, has an empty body, and takes no arguments.Detects unnecessary imports.Checks usages of explicity type arguments in a constructor call that may be replaced by a diamond (<>
).