View Javadoc
1   /*
2   DescendantToken
3   limitedTokens = EMPTY_STAT
4   minimumDepth = (default)0
5   maximumDepth = 0
6   minimumNumber = (default)0
7   maximumNumber = 0
8   sumTokenCounts = (default)false
9   minimumMessage = (default)null
10  maximumMessage = Empty statement.
11  tokens = EMPTY_STAT
12  
13  
14  */
15  
16  package com.puppycrawl.tools.checkstyle.checks.descendanttoken;
17  
18  public class InputDescendantTokenEmptyStatement
19  {
20     public InputDescendantTokenEmptyStatement()
21     {
22        ; // violation 'Empty statement'
23     }
24  
25     public void EmptyMethod()
26     {
27        ; // violation 'Empty statement'
28     }
29  
30     public void EmptyStatements(boolean cond)
31     {
32        for (;cond;); // violation 'Empty statement'
33  
34        for (;cond;)
35        {
36           ; // violation 'Empty statement'
37        }
38  
39        if (true); // violation 'Empty statement'
40  
41        if (true)
42        {
43           ; // violation 'Empty statement'
44        }
45  
46        if (cond)
47        {
48           int i;
49        }
50  
51        else
52        {
53           ; // violation 'Empty statement'
54        }
55  
56        switch (1)
57        {
58           case 1 :
59              ; // violation 'Empty statement'
60           default :
61              ; // violation 'Empty statement'
62        }
63  
64        while (cond); // violation 'Empty statement'
65  
66        while (cond)
67        {
68           ; // violation 'Empty statement'
69        }
70  
71        do; // violation 'Empty statement'
72        while (cond);
73  
74        do
75        {
76           ; // violation 'Empty statement'
77        }
78        while (cond);
79  
80        try
81        {
82           ; // violation 'Empty statement'
83        }
84        catch (Exception ex)
85        {
86           ; // violation 'Empty statement'
87        }
88        finally
89        {
90           ; // violation 'Empty statement'
91        }
92     }
93  }