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



title
5.6.1.7.4 Operators

Padding assignment operators = += -= /= *= ...

Padding assignment operators  = += -= /= *= ...

Controls whether white spaces are inserted before and after assignment operators or not.


Use padding:

int·x·=·y-1;                            


Do not use padding:

int·x=y-1;                              



Padding conditional operators && ||

Padding conditional operators  && ||

Controls whether white spaces are inserted before and after conditional operators or not.


Use padding:

boolean·b·=·condition1·&&·(condition2·||·condition3);


Do not use padding:

boolean·b·=·condition1&&(condition2||condition3);



Padding equality operators == !=

Padding equality operators  == !=

Controls whether white spaces are inserted before and after equaltiy operators or not.


Use padding:

boolean·b·=·(value1·==·value2)·||·(value3·!=·value4);


Do not use padding:

boolean·b·=·(value1==value2)·||·(value3!=value4);



Padding relational operators < > <= =>

Padding relational operators  < > <= =>

Controls whether white spaces are inserted before and after relational operators or not.


Use padding:

boolean·b·=·(value1·<·value2)·||·(value3·=>·value4);


Do not use padding:

boolean·b·=·(value1<value2)·||·(value3=>value4);



Padding additive operators + -

Padding additive operators  + -

Controls whether white spaces are inserted before and after additive operators or not.


Use padding:

int·value·=·a·+·b·-·c;                  


Do not use padding:

int·value·=·a+b-c;                      



Padding multiplicative operators * / %

Padding multiplicative operators  * / %

Controls whether white spaces are inserted before and after multiplicative operators or not.


Use padding:

float·value·=·a·*·b·/·c;                


Do not use padding:

float·value·=·a*b/c;                    



Padding bitwise operators & | ^

Padding bitwise operators  & | ^

Controls whether white spaces are inserted before and after bitwise operators or not.


Use padding:

int·value·=·a·&·255·|·b;                


Do not use padding:

int·value·=·a&255|b;                    



Padding shift operators << >> >>>

Padding shift operators  << >> >>>

Controls whether white spaces are inserted before and after shift operators or not.


Use padding:

byte·value·=·a·<<·3;                    


Do not use padding:

byte·value·=·a<<3;                      



Space before bangs !

Space before bangs !

Controls whether a white space is inserted before bang tokens or not.


Insert a white space before:

if(·!(x·==·3)){                         
    callMethodC();                      
}                                       


Do not insert a white space before:

if(!(x·==·3)){                          
    callMethodC();                      
}                                       



Space after bangs !

Space after bangs !

Controls whether a white space is inserted after bang tokens or not.


Insert a white space after:

if(!·(x·==·3)){                         
    callMethodC();                      
}                                       


Do not insert a white space after:

if(!(x·==·3)){                          
    callMethodC();                      
}                                       



Space before bangs ! appearing together with && ||

Space before bangs ! appearing together with && ||

Controls whether a white space is inserted before bang tokens appearing together with and (&&)/or (||) conditions or not.


Insert a white space before:

if(((w==y)·||·!(w>=0))·&&·!(w<y))·{·    
    
...                                 
}                                       


Do not insert a white space before:

if(((w==y)·||!(w>=0))·&&!(w<y))·{·      
    
...                                 
}                                       



Space after bangs ! appearing together with && ||

Space after bangs ! appearing together with && ||

Controls whether a white space is inserted after bang tokens appearing together with and (&&)/or (||) conditions or not.


Insert a white space after:

if(((w==y)·||!·(w>=0))·&&!·(w<y))·{·    
    
...                                 
}                                       


Do not insert a white space after:

if(((w==y)·||!(w>=0))·&&!(w<y))·{·      
    
...                                 
}                                       



Space before tildes ~

Space before tildes ~

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


Insert a white space before:

byte·u·=·~1;                            


Do not insert a white space before:

byte·u·=~1;                             



Space after tildes ~

Space after tildes ~

Controls whether a white space is inserted after tildes or not.


Insert a white space after:

byte·u·=·~1;                            


Do not insert a white space after:

byte·u·=·~·1;                           



Padding of exception multicatch operators |

Padding of exception multicatch operators |

Controls whether white spaces are inserted before and after exception multicatch operators or not.


Use padding:

try·{                                   
···//·do·something                      
}·catch(final·ExceptionA·|·ExceptionB·|·ExceptionC·ex)·{
···log(ex);                             
}                                       


Do not use padding:

try·{                                   
···//·do·something                      
}·catch(final·ExceptionA|ExceptionB|ExceptionC·ex)·{
···log(ex);                             
}