View Javadoc
1   package com.google.checkstyle.test.chapter5naming.rule526parameternames;
2   
3   import java.io.*;
4   
5   class InputParameterName
6   {
7   
8       /** Some more Javadoc. */
9       public void doSomething(int aaa, int abn, String aaA, 
10              boolean bB) //warn
11      {
12          for (Object O : new java.util.ArrayList())
13          {
14  
15          }
16      }
17  }
18  
19  
20  /** Test enum for member naming check */
21  enum MyEnum1
22  {
23      /** ABC constant */
24      ABC,
25  
26      /** XYZ constant */
27      XYZ;
28  
29      /** Should be mSomeMemeber */
30      private int someMember;
31      
32      public void doEnum(int aaaL,
33      		long llll_llll, //warn
34              boolean bB) {} //warn 
35  }
36  
37  /** Test public vs private method parameter naming check. */
38  class InputParameterNameSimplePub
39  {
40      /** Valid: public and more than one char Long */
41      public void a(int par, int parA) {}
42  
43      /** Invalid: public and one char long */
44      public void b(int p) {}
45  
46      /** Valid: private and one char long. */
47      private void c(int p) {}
48  
49      /** Holder for inner anonymous classes */
50      private void d(int param) {
51          new Object() {
52              /** Invalid: public and one char long. */
53              public void e(int p) { }
54          };
55      }
56  
57      /** Invalid: public constructor and one char long */
58      public InputParameterNameSimplePub(int p) { }
59  
60      /** Valid: private constructor and one char long */
61      private InputParameterNameSimplePub(float p) { }
62  
63      void toManyArgs(
64          int $arg1, //warn
65          int ar$g2, //warn
66          int arg3$, //warn
67          int a_rg4, //warn
68          int _arg5, //warn
69          int arg6_, //warn
70          int aArg7, //warn
71          int aArg8, //warn
72          int aar_g) //warn
73  
74      {}
75  }