View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="ConstantName">
5         <property name="format"
6                   value="^log(ger)?$|^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
7       </module>
8     </module>
9   </module>
10  
11  
12  */
13  
14  package com.puppycrawl.tools.checkstyle.checks.naming.constantname;
15  
16  // xdoc section -- start
17  class Example2 {
18    public final static int FIRST_CONSTANT1 = 10;
19    protected final static int SECOND_CONSTANT2 = 100;
20    final static int third_Constant3 = 1000; // violation 'must match pattern'
21    private final static int fourth_Const4 = 50; // violation 'must match pattern'
22    public final static int log = 10;
23    protected final static int logger = 50;
24    final static int loggerMYSELF = 5; // violation 'must match pattern'
25    final static int MYSELF = 100;
26    protected final static int myselfConstant = 1; // violation 'must match pattern'
27  }
28  // xdoc section -- end