View Javadoc
1   /*
2   LocalVariableName
3   format = (default)^([a-z][a-zA-Z0-9]*|_)$
4   allowOneCharVarInForLoop = (default)false
5   
6   
7   */
8   
9   package com.puppycrawl.tools.checkstyle.checks.naming.localvariablename;
10  import java.io.*;
11  /**
12   * Contains simple mistakes:
13   * - Long lines
14   * - Tabs
15   * - Format of variables and parameters
16   * - Order of modifiers
17   * @author Oliver Burn
18   **/
19  
20  /** Test class for variable naming in for each clause. */
21  class InputLocalVariableName2one
22  {
23      /** Some more Javadoc. */
24      public void doSomething()
25      {
26          //"O" should be named "o"
27          for (Object O : new java.util.ArrayList()) // violation
28          {
29  
30          }
31          for (final int k_ : new int[] {}) {}
32      }
33  }
34  
35  /** Test enum for member naming check */
36  enum InputLocalVariableNameEnum1
37  {
38      /** ABC constant */
39      ABC,
40  
41      /** XYZ constant */
42      XYZ;
43  
44      /** Should be mSomeMember */
45      private int someMember;
46  }