View Javadoc
1   package com.puppycrawl.tools.checkstyle.checks.naming.methodname;
2   
3   /**
4    * Test input for MethodNameCheck specifically
5    * whether the method name equals the class name.
6    *
7    * @author Travis Schneeberger
8    */
9   public class InputMethodNameEqualClassName {
10  
11  	//illegal name
12      public int InputMethodNameEqualClassName() {
13          return 0;
14      }
15  
16      //illegal name
17      private int PRIVATEInputMethodNameEqualClassName() {
18          return 0;
19      }
20  
21      class Inner {
22  		//illegal name
23          public int Inner() {
24  			return 0;
25  		}
26  
27  		//OK name - name of the outter class's ctor
28          public int InputMethodNameEqualClassName() {
29  			return 0;
30  		}
31  	}
32  
33  	public void anotherMethod() {
34  		new InputMethodNameEqualClassName() {
35  
36  			//illegal name
37              public int InputMethodNameEqualClassName() {
38  				return 1;
39  			}
40  		};
41  	}
42  }
43  
44  interface SweetInterface {
45  	
46  	//illegal name
47      int SweetInterface();
48  }
49  
50  class Outer {
51  	
52  	//illegal name
53      public void Outer() {
54  		
55  	}
56  }