0

Does anyone have any workarounds for CheckStyle and StaticMetamodel (which totally set aside TypeName and getter/setter best practices.

@StaticMetamodel(Student.class)
public abstract class Student_ {
    public static volatile SingularAttribute<Student, String> firstName;
    public static volatile SingularAttribute<Student, String> lastName;
    public static final String FIRST_NAME = "firstName";
    public static final String LAST_NAME = "lastName";
}

Checkstyle warnings:

Name 'Student_' must match pattern '^[A-Z][a-zA-Z0-9]*$'. (8:20) [TypeName]
Variable 'firstName' must be private and have accessor methods. (11:75) [VisibilityModifier]
Variable 'lastName' must be private and have accessor methods. (15:77) [VisibilityModifier]
granadaCoder
  • 26,328
  • 10
  • 113
  • 146

1 Answers1

0

So one answer is to use these suppressions.

@SuppressWarnings({"checkstyle:typename", "checkstyle:visibilitymodifier"})

Note, you have to wire up suppressions correctly.

See this:

Ignoring of Checkstyle warnings with annotation @SuppressWarnings

granadaCoder
  • 26,328
  • 10
  • 113
  • 146