View Javadoc
1   package com.google.checkstyle.test.chapter4formatting.rule412nonemptyblocks;
2   
3   class InputLeftCurlyMethod
4   { //warn
5       InputLeftCurlyMethod() {} //ok
6       InputLeftCurlyMethod(String aOne) {//ok
7       }
8       InputLeftCurlyMethod(int aOne)
9       { //warn
10      }
11  
12      void method1() {}//ok
13      void method2() {//ok
14      }
15      void method3()
16      { //warn
17      }
18      void                                                               method4()
19      { //warn
20      }
21      void method5(String aOne,
22                   String aTwo)
23      {//warn
24      }
25      void method6(String aOne,
26                   String aTwo) {// ok
27      }
28  }
29  
30  enum InputLeftCurlyMethodEnum
31  {//warn
32      CONSTANT1("hello")
33      {//warn
34          void method1() {}//ok
35          void method2() {
36          }//ok
37          void method3()
38          {//warn
39          }
40          void                                                               method4()
41          { //warn
42          }
43          void method5(String aOne,
44                       String aTwo)
45          {//warn
46          }
47          void method6(String aOne,
48                       String aTwo) {//ok
49          }
50      },
51  
52      CONSTANT2("hello") {//ok
53  
54      },
55      
56      CONSTANT3("hellohellohellohellohellohellohellohellohellohellohellohellohellohello")
57      {//warn
58      };
59  
60      private InputLeftCurlyMethodEnum(String value)
61      {//warn
62  
63      }
64  
65      void method1() {}//ok
66      void method2() {//ok
67      }
68      void method3()
69      {//warn
70      }
71      void                            method4()
72      {//warn
73      }
74      void method5(String aOne,
75                   String aTwo)
76      {//warn
77      }
78      void method6(String aOne,
79                   String aTwo) {// ok
80      }
81  }
82