Jindent - Java Source Code Formatter http://www.jindent.com
 



title
5.6.1.7.8 Semicolons

Space before semicolons

Space before semicolons

Controls whether a white space is inserted before semicolons or not.


Insert a white space before:

int·x·=·0·;                             
                                        
callMethod(x)
·;                         


Do not insert a white space before:

int·x·=·0;                              
                                        
callMethod(x);                          



Space before semicolons of for statements

Space before semicolons of for statements

Controls whether a white space is inserted before semicolons within for statements or not.


Insert a white space before:

for·(int·i=0·;i<n·;i++)·{               
    ...                                 
}                                       


Do not insert a white space before:

for·(int·i=0;i<n;i++)·{                 
    ...                                 
}                                       



Space after semicolons of for statements

Space after semicolons of for statements

Controls whether a white space is inserted after semicolons within for statements or not.


Insert a white space before:

for·(int·i=0;·i<n;·i++)·{               
    ...                                 
}                                       


Do not insert a white space before:

for·(int·i=0;i<n;i++)·{                 
    ...                                 
}                                       



Do not insert spaces into empty for statements

Do not insert spaces into empty for statements

Controls whether white spaces are inserted between semicolons of empty expression within for statements or not.


We assume the settings "Space before semicolons of for statements" and "Space after semicolons of for statements" are turned on and we even allow insertion of white spaces between empty semicolons:

for·(·;·;·)·{                           
    ...                                 
}                                       


The same example above, but now we do not insert white spaces between empty semicolons:

for·(;;)·{                              
    ...                                 
}