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