resources.report.rules.pmd.FieldDeclarationsShouldBeAtStartOfClass.html Maven / Gradle / Ivy
FieldDeclarationsShouldBeAtStartOfClass
FieldDeclarationsShouldBeAtStartOfClass
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.
This rule is defined by the following Java class: net.sourceforge.pmd.lang.java.rule.design.FieldDeclarationsShouldBeAtStartOfClassRule
Example(s):
public class HelloWorldBean {
// Field declared before methods / inner classes - OK
private String _thing;
public String getMessage() {
return "Hello World!";
}
// Field declared after methods / inner classes - avoid this
private String _fieldInWrongLocation;
}