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



title
5.6.1.9.2 Policy

Conditional operators: && ||

Conditional operators: && ||

Determines whether line breaks are proceed before or after conditional operators.


Wrap before conditional operators:

if (conditionA() && conditionB()        |
    
&& conditionC() && conditionD())    |
{                                       |
    
...                                 |
}                                       |


Wrap after conditional operators:

if (conditionA() && conditionB() &&     |
    
conditionC() && conditionD())       |
{                                       |
    
...                                 |
}                                       |



Comparison operators: < > == != ...

Comparison operators: < > == != ...

Determines whether line breaks are proceed before or after comparison operators.


Wrap before comparison operators:

if (functionA(a, b, c, d, e)            |
    
< functionB(f, g, h, i, j))         |
{                                       |
    
...                                 |
}                                       |


Wrap after comparison operators:

if (functionA(a, b, c, d, e) <          |
    
functionB(f, g, h, i, j))           |
{                                       |
    
...                                 |
}                                       |



Numerical operators: + - * / % & | << >> ...

Numerical operators: + - * / % & | << >> ...

Determines whether line breaks are proceed before or after numerical operators.


Wrap before numerical operators:

x = (y * 100) + 42       |
    
+ (100 - z);         |


Wrap after numerical operators:

x = (y * 100) + 42 +     |
    
(100 - z);           |



Allow wrapping after assignments =

Allow wrapping after assignments =

Determines whether line breaks are allowed after assignments or not.


Allow wrapping after assignments:

if (x == 0                                                |
{                                                           |
    
myNewValue =                                            |
         
new aVeryLongConstructorWhichIsNotEasyToWrap();    |
}                                                           |


Do not allow wrapping after assignments:

if (x == 0                                                |
{                                                           |
    
myNewValue = new aVeryLongConstructorWhichIsNotEasyToWrap();
}
                                                           |



Allow wrapping after left parentheses (

Allow wrapping after left parentheses (

Determines whether line breaks are allowed after left parentheses or not.


Do not allow wrapping after left parentheses:

if (x == 0                                                                  |
{                                                                             |
    
stringBuffer = new StringBuffer("a pretty long String value which is not easy to wrap");
}
                                                                             |


Allow wrapping after left parentheses:

if (x == 0                                                                  |
{                                                                             |
    
stringBuffer = new StringBuffer(                                          |
        
"a pretty long String value which is not easy to wrap");              |
}                                                                             |