http://www.jindent.com |
|
Next: Brackets |
Combine padding parentheses to prevent white spaces |
if(·(·(·x·==·10·)·||·(·0·<·y·)·)·&&·(·y·<=·10·)·)·{ ... } |
if(((·x·==·10·)·||·(·0·<·y·))·&&·(·y·<=·10·))·{ ... } |
Space before left parentheses of constructor and method declarations |
public·void·methodA·(int·param) { ... } |
public·void·methodA(int·param) { ... } |
Space before left parentheses of constructor and method calls |
if·(a·<·10) { callMethod·(a); } |
if·(a·<·10) { callMethod(a); } |
Padding parentheses of constructor and method declarations |
public·void·method(·int·a,·int·b·)·{ ... } |
public·void·method(int·a,·int·b)·{ ... } |
Padding parentheses of constructor and method calls |
if·(a·<·10)·{ callMethod(·int·a·); ... } |
if·(a·<·10)·{ callMethod(int·a); ... } |
See also: | Combine padding parentheses to prevent white spaces |
No padding of empty parentheses |
public·void·method(·int·a,·int·b·)·{ callMethod(·int·a·); doNothing(·); ... } public·void·doNothing(·)·{ ... } |
public·void·method(·int·a,·int·b·)·{ callMethod(·int·a·); doNothing(); ... } public·void·doNothing()·{ ... } |
Padding expression parentheses |
boolean·value·=·(·x·==·10·)·||·(·0·<·y·); |
boolean·value·=·(x·==·10)·||·(0·<·y); |
See also: | Combine padding parentheses to prevent white spaces |
Space before left parentheses of annotation type member declarations |
@interface·RequestForEnhancement { int·id·(); String·synopsis·(); } |
@interface·RequestForEnhancement { int·id(); String·synopsis(); } |
Space before left parentheses of single-member annotations |
@Copyright·("2002·Yoyodyne·Propulsion·Systems,·Inc.,·All·rights·reserved.") public·class·ClassA·{ ... } |
@Copyright("2002·Yoyodyne·Propulsion·Systems,·Inc.,·All·rights·reserved.") public·class·ClassA·{ ... } |
Padding parentheses of single-member annotations |
@Copyright(·"2002·Yoyodyne·Propulsion·Systems,·Inc.,·All·rights·reserved."·) public·class·ClassA·{ ... } |
@Copyright("2002·Yoyodyne·Propulsion·Systems,·Inc.,·All·rights·reserved.") public·class·ClassA·{ ... } |
See also: | Combine padding parentheses to prevent white spaces |
Space before left parentheses of normal annotations |
@RequestForEnhancement·(id=2868724,·synopsis="Provide·time-travel·functionality") public·float·methodA()·{ ... } |
@RequestForEnhancement(id=2868724,·synopsis="Provide·time-travel·functionality") public·float·methodA()·{ ... } |
Padding parentheses of normal annotations |
@RequestForEnhancement(·id=2868724,·synopsis="Provide·time-travel·functionality"·) public·float·methodA()·{ ... } |
@RequestForEnhancement(id=2868724,·synopsis="Provide·time-travel·functionality") public·float·methodA()·{ ... } |
See also: | Combine padding parentheses to prevent white spaces |
Space before left parentheses of for statements |
for
statements or not.
for·(int·i·=·0;·i·<·n;·i++)·{ ... } |
for(int·i·=·0;·i·<·n;·i++)·{ ... } |
Padding parentheses of for statements |
for
statements or not.
for·(·int·i·=·0;·i·<·10;·i++·)·{ ... } |
for·(int·i·=·0;·i·<·10;·i++)·{ ... } |
See also: | Combine padding parentheses to prevent white spaces |
Space before left parentheses of if statements |
if
statements or not.
if·(a·<·10)·{ ... } |
if(a·<·10)·{ ... } |
Padding parentheses of if statements |
if
statements or not.
if·(·x·<·y·)·{ ... } |
if·(x·<·y)·{ ... } |
See also: | Combine padding parentheses to prevent white spaces |
Space before left parentheses of while statements |
while
statements or not.
while·(i·<·10)·{ ... } |
while(i·<·10)·{ ... } |
Padding parentheses of while statements |
while
statements or not.
while·(·i·<·10·)·{ ... } |
while·(i·<·10)·{ ... } |
See also: | Combine padding parentheses to prevent white spaces |
Space before left parentheses of try statements |
try
statements or not.
try·(InputStream·fis·=·new·FileInputStream(source))·{ ... }·catch·(Exception·e)·{ ... } |
try(InputStream·fis·=·new·FileInputStream(source))·{ ... }·catch(Exception·e)·{ ... } |
Padding parentheses of try statements |
try
statements or not.
try·(·InputStream·fis·=·new·FileInputStream(source)·)·{ ... }·catch·(·Exception·e·)·{ ... } |
try·(InputStream·fis·=·new·FileInputStream(source))·{ ... }·catch·(Exception·e)·{ ... } |
Space before left parentheses of catch statements |
catch
statements or not.
try·{ ... }·catch·(Exception·e)·{ ... } |
try·{ ... }·catch(Exception·e)·{ ... } |
Padding parentheses of catch statements |
catch
statements or not.
try·{ ... }·catch·(·Exception·e·)·{ ... } |
try·{ ... }·catch·(Exception·e)·{ ... } |
Space before left parentheses of switch statements |
switch
statements or not.
switch·(a)·{ case·1·: ... } |
switch(a)·{ case·1·: ... } |
Padding parentheses of switch statements |
switch
statements or not.
switch·(·a·)·{ case·1·: ... } |
switch·(a)·{ case·1·: ... } |
Space before left parentheses of synchronized statements |
synchronized
statements or not.
synchronized·(a)·{ ... } |
synchronized(a)·{ ... } |
Padding parentheses of synchronized statements |
synchronized
statements or not.
synchronized·(·a·)·{ ... } |
synchronized·(a)·{ ... } |
Space before left parentheses of throw statement |
throw
statements or not.throw
statements
as method calls.)
throw·(new·MyException()) |
throw(new·MyException()) |
Space before left parentheses of return statement |
return
statements or not.return
statements
as method calls.)
return·(value); |
return(value); |
Space before left parentheses of assert statement |
assert
statements or not.
assert·(a·<·10); |
assert(a·<·10); |
Padding parentheses of castings |
int·value·=·(·int·)·floatValue; |
int·value·=·(int)·floatValue; |
See also: | Combine padding parentheses to prevent white spaces |
Space after right parentheses of castings |
int·value·=·(int)·floatValue; |
int·value·=·(int)floatValue; |
Space before left parentheses of enum constants |
enum
constants or not.
enum·Nummer·{ EINS·(1),·ZWEI·(2),·DREI·(3),·VIER·(4) } |
enum·Nummer·{ EINS(1),·ZWEI(2),·DREI(3),·VIER(4) } |
Padding parentheses of enum constants |
enum
constants or not.
enum·Nummer·{ EINS·(·1·),·ZWEI·(·2·),·DREI·(·3·),·VIER·(·4·) } |
enum·Nummer·{ EINS·(1),·ZWEI·(2),·DREI·(3),·VIER·(4) } |