ASWEB - Avoid Statements With Empty Body

As far as possible avoid statements with empty body.

Wrong

StringTokenizer st = new StringTokenizer(class1.getName(), ".", true);
String s;
for( s = ""; st.countTokens() > 2;
    s = s + st.nextToken() );

Tip: Provide statement body or change the logic of the program (for example, use while statement instead of for statement)

Right

StringTokenizer st = new StringTokenizer(class1.getName(), ".", true);
String s = "";
while( st.countTokens() > 2 ) {
    s += st.nextToken();
}