View Javadoc
1   /*
2   UncommentedMain
3   excludedClasses = \\.Main.*$
4   
5   
6   */
7   
8   package com.puppycrawl.tools.checkstyle.checks.uncommentedmain;
9   
10  /**
11   * Test case for UncommentedMainCheck
12   * @author o_sukhodolsky
13   */
14  public class InputUncommentedMain6
15  {
16      // uncommented main
17      public static void main(String[] args) // violation
18      {
19          System.identityHashCode("InputUncommentedMain.main()");
20      }
21  }
22  
23  class Main2
24  {
25      // uncommented main in class Main
26      public static void main(String[] args)
27      {
28          System.identityHashCode("Main.main()");
29      }
30  }
31  
32  class UncommentedMainTest61
33  {
34      // one more uncommented main
35      public static void main(String[] args) // violation
36      {
37          System.identityHashCode("test1.main()");
38      }
39  }
40  
41  class UncommentedMainTest62
42  {
43      // wrong arg type
44      public static void main(int args)
45      {
46          System.identityHashCode("test2.main()");
47      }
48  }
49  
50  class UncommentedMainTest63
51  {
52      // no-public main
53      static void main(String[] args)
54      {
55          System.identityHashCode("test3.main()");
56      }
57  }
58  
59  class UncommentedMainTest64
60  {
61      // non-static main
62      public void main(String[] args)
63      {
64          System.identityHashCode("test4.main()");
65      }
66  }
67  
68  class UncommentedMainTest65
69  {
70      // wrong return type
71      public static int main(String[] args)
72      {
73          System.identityHashCode("test5.main()");
74          return 1;
75      }
76  }
77  
78  class UncommentedMainTest66
79  {
80      // too many params
81      public static void main(String[] args, int param)
82      {
83          System.identityHashCode("test6.main()");
84      }
85  }
86  
87  class UncommentedMainTest67
88  {
89      // main w/o params
90      public static void main()
91      {
92          System.identityHashCode("test7.main()");
93      }
94  }
95  
96  class UncommentedMainTest68
97  {
98  
99      public static void main(String... args) // violation
100     {
101         System.identityHashCode("test8.main()");
102     }
103 }
104 
105 class UncommentedMainTest69
106 {
107 
108     public static void main(String args)
109     {
110         System.identityHashCode("test9.main()");
111     }
112 }