View Javadoc
1   /*
2   EmptyStatement
3   
4   
5   */
6   
7   package com.puppycrawl.tools.checkstyle.checks.coding.emptystatement;
8   
9   /**
10   * Input class for testing EmptyStatementCheck
11   * @author Rick Giles
12   * @version 5-May-2003
13   */
14  public class InputEmptyStatement
15  {
16     public InputEmptyStatement()
17     {
18        ; // violation 'Empty statement'
19     }
20  
21     public void EmptyMethod()
22     {
23        ; // violation 'Empty statement'
24     }
25  
26     public void EmptyStatements(boolean cond)
27     {
28        for (;cond;); // violation 'Empty statement'
29  
30        for (;cond;)
31        {
32           ; // violation 'Empty statement'
33        }
34  
35        if (true); // violation 'Empty statement'
36  
37        if (true)
38        {
39           ; // violation 'Empty statement'
40        }
41  
42        if (cond)
43        {
44           int i;
45        }
46  
47        else
48        {
49           ; // violation 'Empty statement'
50        }
51  
52        switch (1)
53        {
54           case 1 :
55              ; // violation 'Empty statement'
56           default :
57              ; // violation 'Empty statement'
58        }
59  
60        while (cond); // violation 'Empty statement'
61  
62        while (cond)
63        {
64           ; // violation 'Empty statement'
65        }
66  
67        do; // violation 'Empty statement'
68        while (cond);
69  
70        do
71        {
72           ; // violation 'Empty statement'
73        }
74        while (cond);
75  
76        try
77        {
78           ; // violation 'Empty statement'
79        }
80        catch (Exception ex)
81        {
82           ; // violation 'Empty statement'
83        }
84        finally
85        {
86           ; // violation 'Empty statement'
87        }
88     }
89  }