package com.siyeh.igtest.controlflow.switch_statement_density;

public class SwitchStatementDensity
{
    private int m_bar;

    public SwitchStatementDensity()
    {
        m_bar = 0;
    }

    public void fooBar()
    {
        final int bar = m_bar;
        <warning descr="'switch' has too low of a branch density (19%)">switch</warning>(bar)
        {
            case 3:
            case 4:
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                System.out.println("3");
                break;
            case 6:
                System.out.println("4");
                break;
            default:
                break;
        }
        switch(bar) {}

    }

    public int switchExpression(int e) {
        return <warning descr="'switch' has too low of a branch density (11%)">switch</warning> (e) {
            case 1:
                System.out.println(e);
                System.out.println(e);
                System.out.println(e);
                System.out.println(e);
                System.out.println(e);
                System.out.println(e);
                System.out.println(e);
                System.out.println(e);
                System.out.println(e);
                System.out.println(e);
                System.out.println(e);
                System.out.println(e);
                System.out.println(e);
                System.out.println(e);
                System.out.println(e);
                System.out.println(e);
                System.out.println(e);
                System.out.println(e);
                break 1;
            default:
                break 0;

        };
    }
}

@@ -2358,11 +2358,1029 @@
 %7D;%0A    %7D
+%0A%0A    public void ruleBaseSwitch(String s) %7B%0A        %3Cwarning descr=%22'switch' has too low of a branch density (9%25)%22%3Eswitch%3C/warning%3E (s) %7B%0A            case %22one%22 -%3E %7B%0A                System.out.println(1);%0A                System.out.println(1);%0A                System.out.println(1);%0A                System.out.println(1);%0A                System.out.println(1);%0A                System.out.println(1);%0A                System.out.println(1);%0A                System.out.println(1);%0A                System.out.println(1);%0A                System.out.println(1);%0A                System.out.println(1);%0A                System.out.println(1);%0A                System.out.println(1);%0A                System.out.println(1);%0A                System.out.println(1);%0A                System.out.println(1);%0A                System.out.println(1);%0A                System.out.println(1);%0A                System.out.println(1);%0A            %7D%0A            case %22two%22 -%3E %7B%0A                System.out.println(2);%0A            %7D%0A        %7D%0A    %7D
 %0A%7D%0A

add test case for rule based switch