View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="AbbreviationAsWordInName">
5         <property name="ignoreStatic" value="false"/>
6         <property name="ignoreOverriddenMethods" value="false"/>
7       </module>
8     </module>
9   </module>
10  
11  
12  */
13  
14  package com.puppycrawl.tools.checkstyle.checks.naming.abbreviationaswordinname;
15  
16  import java.util.HashSet;
17  import java.util.Set;
18  
19  // xdoc section -- start
20  class Example2 extends SuperClass { // OK, camel case
21    int CURRENT_COUNTER; // violation 'no more than '4' consecutive capital letters'
22    // violation below 'no more than '4' consecutive capital letters'
23    static int GLOBAL_COUNTER;
24    final Set<String> stringsFOUND = new HashSet<>(); // OK, final is ignored
25  
26    @Override // violation below 'no more than '4' consecutive capital letters'
27    public void printCOUNTER() {
28      System.out.println(CURRENT_COUNTER); // OK, only definitions are checked
29    }
30    // violation below 'no more than '4' consecutive capital letters'
31    void incrementCOUNTER() {
32      CURRENT_COUNTER++; // OK, only definitions are checked
33    }
34    // violation below 'no more than '4' consecutive capital letters'
35    static void incrementGLOBAL() {
36      GLOBAL_COUNTER++; // OK, only definitions are checked
37    }
38  }
39  // xdoc section -- end