View Javadoc
1   package com.puppycrawl.tools.checkstyle.checks.blocks.leftcurly;
2   
3   import java.lang.annotation.ElementType;
4   import java.lang.annotation.Target;
5   import java.util.ArrayList;
6   import java.util.List;
7   
8   class InputLeftCurlyLineBreakAfter
9   {
10      /** @see test method **/
11      int foo() throws InterruptedException
12      {
13          int x = 1;
14          int a = 2;
15          while (true)
16          {
17              try
18              {
19                  if (x > 0)
20                  {
21                      break;
22                  }
23                  else if (x < 0) {
24                      ;
25                  }
26                  else { break; }
27                  switch (a)
28                  {
29                  case 0:
30                      break;
31                  default:
32                      break;
33                  }
34              }
35              catch (Exception e) { break; }
36              finally { break; }
37          }
38  
39          synchronized (this) { do { x = 2; } while (x == 2); }
40          
41          synchronized (this) {
42              do {} while (x == 2);
43          }
44  
45          for (int k = 0; k < 1; k++) { String innerBlockVariable = ""; }
46  
47          for (int k = 0; k < 1; k++) {}
48  		return a;
49      }
50  
51      static { int x = 1; }
52  
53      void method2()
54      {
55          boolean flag = false;
56          if (flag) { String.valueOf("foo"); }
57      }
58  }
59  
60  class Absent_CustomFieldSerializer1 {
61  
62      public static void serialize() {} 
63  }
64  
65  class Absent_CustomFieldSerializer2
66  {
67      public Absent_CustomFieldSerializer2() {}
68  }
69  
70  class EmptyClass1 {}
71  
72  interface EmptyInterface1 {}
73  
74  enum KnownOrder { KNOWN_ORDER, UNKNOWN_ORDER }