diff options
Diffstat (limited to 'plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/empty_statement_body')
2 files changed, 104 insertions, 0 deletions
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/empty_statement_body/EmptyStatementBody.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/empty_statement_body/EmptyStatementBody.java new file mode 100644 index 000000000000..38f7601b13ab --- /dev/null +++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/empty_statement_body/EmptyStatementBody.java @@ -0,0 +1,39 @@ +package com.siyeh.igtest.bugs.empty_statement_body; + +public class EmptyStatementBody +{ + private void foo(int j) + { + while(bar()); + while(bar()){ + + } + for(int i = 0;i<4;i++); + for(int i = 0;i<4;i++) + { + + } + if(bar()); + if(bar()){ + + } + if(bar()){ + return; + } + else + { + + } + if(bar()){ + return; + } + else; + + switch (j) {} + } + + private boolean bar() + { + return true; + } +} diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/empty_statement_body/expected.xml b/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/empty_statement_body/expected.xml new file mode 100644 index 000000000000..2132751ff25d --- /dev/null +++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/empty_statement_body/expected.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> +<problems> + <problem> + <file>EmptyStatementBody.java</file> + <line>7</line> + <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Statement with empty body</problem_class> + <description><code>while</code> statement has empty body #loc</description> + </problem> + + <problem> + <file>EmptyStatementBody.java</file> + <line>8</line> + <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Statement with empty body</problem_class> + <description><code>while</code> statement has empty body #loc</description> + </problem> + + <problem> + <file>EmptyStatementBody.java</file> + <line>11</line> + <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Statement with empty body</problem_class> + <description><code>for</code> statement has empty body #loc</description> + </problem> + + <problem> + <file>EmptyStatementBody.java</file> + <line>12</line> + <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Statement with empty body</problem_class> + <description><code>for</code> statement has empty body #loc</description> + </problem> + + <problem> + <file>EmptyStatementBody.java</file> + <line>16</line> + <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Statement with empty body</problem_class> + <description><code>if</code> statement has empty body #loc</description> + </problem> + + <problem> + <file>EmptyStatementBody.java</file> + <line>17</line> + <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Statement with empty body</problem_class> + <description><code>if</code> statement has empty body #loc</description> + </problem> + + <problem> + <file>EmptyStatementBody.java</file> + <line>23</line> + <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Statement with empty body</problem_class> + <description><code>else</code> statement has empty body #loc</description> + </problem> + + <problem> + <file>EmptyStatementBody.java</file> + <line>30</line> + <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Statement with empty body</problem_class> + <description><code>else</code> statement has empty body #loc</description> + </problem> + + <problem> + <file>EmptyStatementBody.java</file> + <line>32</line> + <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Statement with empty body</problem_class> + <description><code>switch</code> statement has empty body #loc</description> + </problem> +</problems>
\ No newline at end of file |