[Skip to content]

2.7.8. White Space

The white space settings page lets you control the white space used to separate individual syntax elements of source files. Making good use of spacing is considered good programming style and therefore Jalopy provides a great amount of configurability.

Because of the sheer amount of options, you can choose between two views that group the available options in different ways to provide a somewhat greater flexibility when adjusting the more than 150 individual options.

Choose view

Lets you choose between different views in which the white space options are presented to the user.

The available choices are:

  • Group by Java Token

    The token view groups the white space options by the Java separator and operator tokens like commas, parentheses or assignments. This is the default and preferred view, because ideally it takes little more than twenty adjustments to configure behavior for all available options.

  • Groupy by Java Element

    The element view groups the white space options logically by the different available elements like declarations, control statements or expressions. This way it is easier to adjust options for just one element as all related options are presented together.

Since 1.6

2.7.8.1. Token view

Figure 2.44. White Space Token View

White Space Token View

2.7.8.1.1. Before operator

Lets you specify what operators should have a blank space printed before.

Assignment operator

Controls whether a blank space will be printed before assignment operators. The assignment operators are: = += -= *= \= %= &= |= ^= <<= >>= >>>=

Example 2.323. Assignment operator

a=(b+c)*d;
a+=12;

Example 2.324. Assignment operator with space before

a =(b+c)*d;
a +=12;

Assignment operator in annotations

Controls whether a blank space will be printed before assignment operators in annotations.

Since 1.9

Example 2.325. Assignment operator

@Name(first="Joe",last="Hacker")

Example 2.326. Assignment operator with space before

@Name(first ="Joe",last ="Hacker")

Bitwise operator

Controls whether a blank space will be printed before bitwise operators. The bitwise operators are: & | ^

Example 2.327. Bitwise operator

return(getOperatingSystem()&PLAT_UNIX)!=0;

Example 2.328. Bitwise operator with space before

return(getOperatingSystem() &PLAT_UNIX)!=0;

Logical operator

Controls whether a blank space will be printed before logical operators. The logical operators are: && ||

Example 2.329. Logical operator

if((LA(1)=='/')&&(LA(2)!='*'||(LA(2)=='*'&&LA(3)!='*'))) ...

Example 2.330. Logical operator with spaces around

if((LA(1)=='/') &&(LA(2)!='*' ||(LA(2)=='*' &&LA(3)!='*'))) ...

Math operator

Controls whether a blank space will be printed before mathematical operators. The mathematical operators are: + - / * %

Example 2.331. Mathematical operator

a=(b+c)*d;

Example 2.332. Mathematical operator with space before

a=(b +c) *d;

Relational operator

Controls whether a blank space will be printed before relational operators. The relational operators are: == != < > <= >=

Example 2.333. Relational operator

if((LA(1)=='\n'||LA(1)=='\r')) ...

Example 2.334. Relational operator with space before

if((LA(1) =='\n'||LA(1) =='\r')) ...

Shift operator

Controls whether a blank space will be printed before shift operators. The shift operators are: << >> >>>

Example 2.335. Shift operator

if(((1L<<i)&l)!=0) ...

Example 2.336. Shift operator with space before

if(((1L <<i)&l)!=0) ...

Postfix operator

Controls whether a blank space will be printed before postfix operators. The postfix operators are: ++ --

Since 1.6

Example 2.337. Postfix operator

int next = i++;

Example 2.338. Postfix operator with space before

int next = i ++;

String concat operator

Controls whether a blank space will be printed before the string concat operator.

Since 1.0.3

Example 2.339. String concat operator

a="a"+1;
b=1+"b";
c=1+2+3+"c";
d="d"+1+2+3;
e="e"+(1+2)+"e";

Example 2.340. String concat operator with space before

a="a" +1;
b=1 +"b";
c=1+2+3 +"c";
d="d" +1 +2 +3;
e="e" +(1+2) +"e";

2.7.8.1.2. After operator

Lets you specify what operators should have a blank space printed after.

Assignment operator

Controls whether a blank space will be printed after assignment operators. The assignment operators are: = += -= *= \= %= &= |= ^= <<= >>= >>>=

Example 2.341. Assignment operator

a=(b+c)*d;
a+=12;

Example 2.342. Assignment operator with space after

a= (b+c)*d;
a+= 12;

Assignment operator in annotations

Controls whether a blank space will be printed after assignment operators in annotations.

Since 1.9

Example 2.343. Assignment operator

@Name(first="Joe",last="Hacker")

Example 2.344. Assignment operator with space after

@Name(first= "Joe",last= "Hacker")

Bitwise operator

Controls whether a blank space will be printed after bitwise operators. The bitwise operators are: & | ^

Example 2.345. Bitwise operator

return(getOperatingSystem()&PLAT_UNIX)!=0;

Example 2.346. Bitwise operator with space after

return(getOperatingSystem()& PLAT_UNIX)!=0;

Logical operator

Controls whether a blank space will be printed after logical operators. The logical operators are: && ||

Example 2.347. Logical operator

if((LA(1)=='/')&&(LA(2)!='*'||(LA(2)=='*'&&LA(3)!='*'))) ...

Example 2.348. Logical operator with spaces around

if((LA(1)=='/')&& (LA(2)!='*'|| (LA(2)=='*'&& LA(3)!='*'))) ...

Complement operator

Controls whether a blank space will be printed after complement operators. The logical operators are: ~ !

Example 2.349. Complement operator

f(!x);

Example 2.350. Complement operator with space after

f(! x);

Mathematical operator

Controls whether a blank space will be printed after mathematical operators. The mathematical operators are: + - / * %

Example 2.351. Mathematical operator

a=(b+c)*d;

Example 2.352. Mathematical operator with space after

a=(b+ c)* d;

Relational operator

Controls whether a blank space will be printed after relational operators. The relational operators are: == != < > <= >=

Example 2.353. Relational operator

if((LA(1)=='\n'||LA(1)=='\r')) ...

Example 2.354. Relational operator with space after

if((LA(1)== '\n'||LA(1)== '\r')) ...

Shift operators

Controls whether a blank space will be printed after shift operators. The shift operators are: << >> >>>

Example 2.355. Shift operator

if(((1L<<i)&l)!=0) ...

Example 2.356. Shift operator with space after

if(((1L<< i)&l)!=0) ...

Prefix operator

Controls whether a blank space will be printed after prefix operators. The prefix operators are: ++ --

Example 2.357. Prefix operator

int previous = --i;

Example 2.358. Prefix operator with space after

int previous = -- i;

Unary operator

Controls whether a blank space will be printed after unary operators. The unary operators are: - +

Since 1.6

Example 2.359. Unary operator

int x  = 3 * -4;

Example 2.360. Unary operator with space after

int x  = 3 * - 4;

String concat operator

Controls whether a blank space will be printed after the string concat operator.

Since 1.0.3

Example 2.361. String concat operator

a="a"+1;
b=1+"b";
c=1+2+3+"c";
d="d"+1+2+3;
e="e"+(1+2)+"e";

Example 2.362. String concat operator with space after

a="a"+ 1;
b=1+ "b";
c=1+2+3+ "c";
d="d"+ 1+ 2+ 3;
e="e"+ (1+2)+ "e";

2.7.8.1.3. Before comma

Lets you specify what commas should have a blank space printed before.

Annotation array

Controls whether a blank space will be printed before commas of annotation arrays.

Example 2.363. Annotation array

@Target({FIELD,METHOD,CONSTRUCTOR})
public class Foo { }

Example 2.364. Annotation array with space before comma

@Target({FIELD ,METHOD ,CONSTRUCTOR})
public class Foo { }

Annotation type member argument

Controls whether a blank space will be printed before commas of annotation member arguments.

Example 2.365. Annotation

@Point(x=23,y=-3)
public class Foo { }

Example 2.366. Annotation with space before comma

@Point(x=23 ,y=-3)
public class Foo { }

Enum constant

Controls whether a blank space will be printed before commas of enum constants.

Example 2.367. Enum constants

enum Color{GREEN,BLUE}

Example 2.368. Enum constants with space before comma

enum Color{GREEN ,BLUE}

Enum constant argument

Controls whether a blank space will be printed before commas of enum constants.

Example 2.369. Enum constant arguments

enum Color{GREEN(0,255.0),BLUE(0,0,255)}

Example 2.370. Enum constant arguments with space before comma

enum Color{GREEN(0 ,255 .0),BLUE(0 ,0 ,255)}

extends/implements

Controls whether a blank space will be printed before the commas of extends and/or implements types.

Extends type

Controls whether a blank space will be printed before the commas of extends types.

Example 2.371. Extends types

interface Fooable extends Doable,Readable {}

Example 2.372. Extends types with space before comma

interface Fooable extends Doable ,Readable {}

Extends type

Controls whether a blank space will be printed before the commas of implements types.

Example 2.373. Implements types

class Foo implements I0,I1,I2 {}

Example 2.374. Implements types with space before comma

class Foo implements I0 ,I1 ,I2 {}

Multiple declarations

Controls whether a blank space will be printed before the commas of multi-field and/or multi-variable declarations.

Field

Controls whether a blank space will be printed before the commas of multi-field declarations.

Example 2.375. Multi-field declaration

class Foo {
    int a=0,b=1,c=2,d=3;
}

Example 2.376. Multi-field declaration with space before commas

class Foo {
    int a=0 ,b=1 ,c=2 ,d=3;
}

Variable

Controls whether a blank space will be printed before the commas of multi-variable declarations.

Example 2.377. Multi-variable declaration

void foo() {
    int a=0,b=1,c=2,d=3;
}

Example 2.378. Multi-variable declaration with space before commas

void foo() {
    int a=0 ,b=1 ,c=2 ,d=3;
}

Declaration parameter

Controls whether a blank space will be printed before the commas of method and/or constructor declarations parameters.

Constructor

Example 2.379. Constructor declaration

Foo(int p1,int p2,int p3) {
}

Example 2.380. Constructor declaration with space before commas

Foo(int p1 ,int p2 ,int p3) {
}

Method

Example 2.381. Method declaration

void foo(int p1,int p2,int p3) {
}

Example 2.382. Method declaration with space before commas

void foo(int p1 ,int p2 ,int p3) {
}

Throws clauses

Controls whether a blank space will be printed before the commas of throws clauses of method and/or constructor declarations.

Constructor

Controls whether a blank space will be printed before the commas of throws clauses of constructor declarations.

Example 2.383. Constructor declaration throws clause

Foo() throws IOException,FooException {
}

Example 2.384. Constructor declaration throws clause with space before commas

Foo() throws IOException ,FooException {
}

Method

Controls whether a blank space will be printed before the commas of throws clauses of method declarations.

Example 2.385. Method declaration throws clause

void foo() throws IOException,FooException {
}

Example 2.386. Method declaration throws clause with space before commas

void foo() throws IOException ,FooException {
}

Call arguments

Controls whether a blank space will be printed before the commas of call arguments.

Constructor

Controls whether a blank space will be printed before the commas of constructor call arguments.

Example 2.387. Constructor call

Foo(int p1,int p2,int p3){
    super(p1,true);
}

Example 2.388. Constructor call space before commas

Foo(int p1,int p2,int p3){
    super(p1 ,true);
}

Method

Controls whether a blank space will be printed before the commas of method call arguments.

Example 2.389. Method call

test(x,y);

Example 2.390. Method call space before commas

test(x ,y);

Creator

Controls whether a blank space will be printed before the commas of creator call arguments.

Example 2.391. Creator call

Point point=new Point(x,y);

Example 2.392. Creator call space before commas

Point point=new Point(x ,y);

Array initializer

Controls whether a blank space will be printed before the commas of array initializers.

Example 2.393. Array initializer

int[] foo=new int[]{1,2,3};

Example 2.394. Array initializer with space before commas

int[] foo=new int[]{1 ,2 ,3};

for

Controls whether a blank space will be printed before the commas of for initializer and/or incrementor parts.

Initializer

Controls whether a blank space will be printed before the commas of for initializer parts.

Example 2.395. for initializer

for(int i=0,j=array.length;i<array.length;i++) {}

Example 2.396. for initializer with space before commas

for(int i=0 ,j=array.length;i<array.length;i++) {}

Incrementor

Controls whether a blank space will be printed before the commas of for incrementor parts.

Example 2.397. for incrementor

for(int i=0,j=array.length;i<array.length;i++,j--) {}

Example 2.398. for incrementor with space before commas

for(int i=0,j=array.length;i<array.length;i++ ,j--) {}

Parameterized types

Controls whether a blank space will be printed before the commas of parameterized types.

Type parameter

Controls whether a blank space will be printed before the commas of type parameters.

Example 2.399. Type parameter

class GenericType<S,T>{}

Example 2.400. Type parameter with space before commas

class GenericType<S ,T>{}

Type argument

Controls whether a blank space will be printed before the commas of type arguments.

Example 2.401. Type argument

caller.<String,Element>foo();

Example 2.402. Type argument with space before commas

caller.<String ,Element>foo();

2.7.8.1.4. After comma

Lets you specify what commas should have a blank space printed after.

Annotation array

Controls whether a blank space will be printed after commas of annotation arrays.

Example 2.403. Annotation array

@Target({FIELD,METHOD,CONSTRUCTOR})
public class Foo { }

Example 2.404. Annotation array with space after comma

@Target({FIELD, METHOD, CONSTRUCTOR})
public class Foo { }

Annotation type member argument

Controls whether a blank space will be printed after commas of annotation member arguments.

Example 2.405. Annotation

@Point(x=23,y=-3)
public class Foo { }

Example 2.406. Annotation with space after comma

@Point(x=23, y=-3)
public class Foo { }

Enum constant

Controls whether a blank space will be printed after commas of enum constants.

Example 2.407. Enum constants

enum Color{GREEN,BLUE}

Example 2.408. Enum constants with space after comma

enum Color{GREEN, BLUE}

Enum constant argument

Controls whether a blank space will be printed after commas of enum constants.

Example 2.409. Enum constant arguments

enum Color{GREEN(0,255.0),BLUE(0,0,255)}

Example 2.410. Enum constant arguments with space after comma

enum Color{GREEN(0, 255, 0),BLUE(0, 0, 255)}

extends/implements

Controls whether a blank space will be printed after the commas of extends and/or implements types.

Extends type

Controls whether a blank space will be printed after the commas of extends types.

Example 2.411. Extends types

interface Fooable extends Doable,Readable {}

Example 2.412. Extends types with space after comma

interface Fooable extends Doable, Readable {}

Implements type

Controls whether a blank space will be printed after the commas of implements types.

Example 2.413. Implements types

class Foo implements I0,I1,I2 {}

Example 2.414. Implements types with space after comma

class Foo implements I0, I1, I2 {}

IMultiple declarations

Controls whether a blank space will be printed after the commas of multi-field and/or multi-variable declarations.

Field

Controls whether a blank space will be printed after the commas of multi-field declarations.

Example 2.415. Multi-field declaration

class Foo {
    int a=0,b=1,c=2,d=3;
}

Example 2.416. Multi-field declaration with space after commas

class Foo {
    int a=0, b=1, c=2, d=3;
}

Variable

Controls whether a blank space will be printed after the commas of multi-variable declarations.

Example 2.417. Multi-variable declaration

void foo() {
    int a=0,b=1,c=2,d=3;
}

Example 2.418. Multi-variable declaration with space after commas

void foo() {
    int a=0, b=1, c=2, d=3;
}

Declaration parameter

Controls whether a blank space will be printed after the commas of method and/or constructor declarations parameters.

Constructor

Controls whether a blank space will be printed after the commas of constructor declarations parameters.

Example 2.419. Constructor declaration

Foo(int p1,int p2,int p3) {
}

Example 2.420. Constructor declaration with space after commas

Foo(int p1, int p2, int p3) {
}

Method

Example 2.421. Method declaration

void foo(int p1,int p2,int p3) {
}

Example 2.422. Method declaration with space after commas

void foo(int p1, int p2, int p3) {
}

Throws clauses

Controls whether a blank space will be printed after the commas of throws clauses of method and/or constructor declarations.

Constructor

Controls whether a blank space will be printed after the commas of throws clauses of constructor declarations.

Example 2.423. Constructor declaration throws clause

Foo() throws IOException,FooException {
}

Example 2.424. Constructor declaration throws clause with space after commas

Foo() throws IOException, FooException {
}

Method

Controls whether a blank space will be printed after the commas of throws clauses of method declarations.

Example 2.425. Method declaration throws clause

void foo() throws IOException,FooException {
}

Example 2.426. Method declaration throws clause with space after commas

void foo() throws IOException, FooException {
}

Call arguments

Controls whether a blank space will be printed after the commas of call arguments.

Constructor

Controls whether a blank space will be printed after the commas of constructor call arguments.

Example 2.427. Constructor call

Foo(int p1,int p2,int p3){
    super(p1,true);
}

Example 2.428. Constructor call space after commas

Foo(int p1,int p2,int p3){
    super(p1, true);
}

Method

Controls whether a blank space will be printed after the commas of method call arguments.

Example 2.429. Method call

test(x,y);

Example 2.430. Method call space after commas

test(x, y);

Creator

Controls whether a blank space will be printed after the commas of creator call arguments.

Example 2.431. Creator call

Point point=new Point(x,y);

Example 2.432. Creator call space after commas

Point point=new Point(x, y);

Array initializer

Controls whether a blank space will be printed after the commas of array initializers.

Example 2.433. Array initializer

int[] foo=new int[]{1,2,3};

Example 2.434. Array initializer with space after commas

int[] foo=new int[]{1, 2, 3};

for

Controls whether a blank space will be printed after the commas of for initializer and/or incrementor parts.

Initializer

Controls whether a blank space will be printed after the commas of for initializer parts.

Example 2.435. for initializer

for(int i=0,j=array.length;i<array.length;i++) {}

Example 2.436. for initializer with space after commas

for(int i=0, j=array.length;i<array.length;i++) {}

Incrementor

Controls whether a blank space will be printed after the commas of for incrementor parts.

Example 2.437. for incrementor

for(int i=0,j=array.length;i<array.length;i++,j--) {}

Example 2.438. for incrementor with space after commas

for(int i=0,j=array.length;i<array.length;i++, j--) {}

Parameterized types

Controls whether a blank space will be printed after the commas of parameterized types.

Type parameter

Controls whether a blank space will be printed after the commas of type parameters.

Example 2.439. Type parameter

class GenericType<S,T>{}

Example 2.440. Type parameter with space after commas

class GenericType<S, T>{}

Type argument

Controls whether a blank space will be printed after the commas of type arguments.

Example 2.441. Type argument

caller.<String,Element>foo();

Example 2.442. Type argument with space after commas

caller.<String, Element>foo();

2.7.8.1.5. Before colon

Lets you specify what colons should have a blank space printed before.

assert

Controls whether colons of assert statements should have a blank space printed before.

Example 2.443. assert statement

assert condition:reportError();

Example 2.444. assert statement with space before colon

assert condition :reportError();

case

Controls whether colons of case statements should have a blank space printed before.

Example 2.445. assert statement

switch (list[i]) {
case 't':
    break;
}

Example 2.446. assert statement with space before colon

switch (list[i]) {
case 't' :
    break;
}

Conditional

Controls whether colons of the conditional operator should have a blank space printed before.

Example 2.447. Conditional operator

String value=condition?TRUE:FALSE;

Example 2.448. Conditional operator with space before colon

String value=condition?TRUE :FALSE;

for

Controls whether colons of enhanced for statements should have a blank space printed before.

Example 2.449. Enhancement for statement

for (String s:names) { }

Example 2.450. Enhanced for statement with space before colon

for (String s :names) { }

Label

Controls whether colons of labeled statements should have a blank space printed before.

Example 2.451. Labeled statement

label: {
   ...
}

Example 2.452. Labeled statement with space before colon

label : {
    ...
}

2.7.8.1.6. After colon

Lets you specify what colons should have a blank space printed after.

assert

Controls whether colons of assert statements should have a blank space printed after.

Example 2.453. assert statement

assert condition:reportError();

Example 2.454. assert statement with space after colon

assert condition: reportError();

Conditional

Controls whether colons of the conditional operator should have a blank space printed after.

Example 2.455. Conditional operator

String value=condition?TRUE:FALSE;

Example 2.456. Conditional operator with space after colon

String value=condition?TRUE: FALSE;

for

Controls whether colons of enhanced for statements should have a blank space printed after.

Example 2.457. Enhancement for statement

for (String s:names) { }

Example 2.458. Enhanced for statement with space after colon

for (String s: names) { }

Label

Controls whether colons of labeled statements should have a blank space printed after.

Example 2.459. Labeled statement

label:for(;;){
   ...
}

Example 2.460. Labeled statement with space after colon

label: for(;;){
    ...
}

Please note that this option only applies when no line break is printed after the colon.

2.7.8.1.7. Before semicolon

Lets you specify what semicolons should have a blank space printed before.

for

Controls whether semicolons of for statements should have a blank space printed before.

Example 2.461. for statement

for(int i=0;i<array.length;i++) {}

Example 2.462. for statement with space before semicolon

for(int i=0 ;i<array.length ;i++) {}

2.7.8.1.8. After semicolon

Lets you specify what semicolons should have a blank space printed after.

for

Controls whether semicolons of for statements should have a blank space printed after.

Example 2.463. for statement

for(int i=0;i<array.length;i++) {}

Example 2.464. for statement with space after semicolon

for(int i=0; i<array.length; i++) {}

2.7.8.1.9. Before question mark

Lets you specify what question marks should have a blank space printed before.

Conditional operator

Controls whether question marks of the conditional operator should have a blank space printed before.

Example 2.465. Conditional operator

String value=condition?TRUE:FALSE;

Example 2.466. Conditional operator with space before question mark

String value=condition ?TRUE:FALSE;

Type parameter

Controls whether question marks of type parameters should have a blank space printed before. Please note that this option only applies if no white space after the left angle bracket is forced (See "Space after left bracket type parameter").

Example 2.467. Type parameter

class QuestionMark<T extends Comparable< ? super Number>> {}

Example 2.468. Type parameter with space before question mark

class QuestionMark<T extends Comparable< ? super Number>> {}

Type argument

Controls whether question marks of type arguments should have a blank space printed before. Please note that this option only applies if no white space after the left angle bracket and/or commas is forced (See "Space after left bracket type argument").

Example 2.469. Type argument

Map<X<?>,Y<? extends K,? super V>>t;

Example 2.470. Type argument with space before question mark

Map<X< ?>,Y< ? extends K, ? super V>>t;

2.7.8.1.10. After question mark

Lets you specify what question marks should have a blank space printed after.

Conditional operator

Controls whether question marks of the conditional operator should have a blank space printed after.

Example 2.471. Conditional operator

String value=condition?TRUE:FALSE;

Example 2.472. Conditional operator with space after question mark

String value=condition? TRUE:FALSE;

Type parameter

Controls whether question marks of type parameters should have a blank space printed after. Please note that this option only applies if no white space before the right angle bracket is forced (See "Space before right angle bracket type parameter").

Example 2.473. Type parameter

class X10<T extends Map.Entry<?,?>> {}

Example 2.474. Type parameter with space after question mark

class X10<T extends Map.Entry<? ,? >> {}

Type argument

Controls whether question marks of type arguments should have a blank space printed after. Please note that this option only applies if no white space before the right angle bracket and/or commas is forced (See "Space before right angle bracket type argument").

Example 2.475. Type argument

Map<X<?>,Y>t;

Example 2.476. Type argument with space after question mark

Map<X<? >,Y>t;

2.7.8.1.11. Before ellipsis

Lets you specify whether a blank space should be printed before the ellipsis.

Vararg

Controls whether a blank space will be printed before the ellipsis of a variable arity parameter (varag).

Since 1.2

Example 2.477. Vararg ellipsis

public void test(String[]...args) {
}

Example 2.478. Vararg ellipsis with space before

public void test(String[] ...args) {
}

2.7.8.1.12. After ellipsis

Lets you specify whether a blank space should be printed after the ellipsis.

Vararg

Controls whether a blank space will be printed after the ellipsis of a variable arity parameter (varag).

Since 1.6

Example 2.479. Vararg ellipsis

public void test(String[]...args) {
}

Example 2.480. Vararg ellipsis with space after

public void test(String[]... args) {
}

2.7.8.1.13. Before ampersand

Lets you specify whether a blank space should be printed before the ampersand.

Type parameter

Controls whether a blank space will be printed before the ampersand of type parameters.

Since 1.6

Example 2.481. Type parameter

class Foo<S,T extends Element&List> {
}

Example 2.482. Type parameter with space before ampersand

class Foo<S,T extends Element &List> {
}

2.7.8.1.14. After ampersand

Lets you specify whether a blank space should be printed after the ampersand.

Type parameter

Controls whether a blank space will be printed after the ampersand of type parameters.

Since 1.6

Example 2.483. Type parameter

class Foo<S,T extends Element&List> {
}

Example 2.484. Type parameter with space after ampersand

class Foo<S,T extends Element& List> {
}

2.7.8.1.15. Before left parenthesis

Lets you specify what left parentheses should have a blank space printed before.

Annotation argument list

Controls whether a blank space should be printed before the left parenthesis of annotation argument lists.

Example 2.485. Annotation

@Annot(x=23,y=-3)
class Foo {
}

Example 2.486. Annotation with space before argument list

@Annot (x=23,y=-3)
class Foo {
}

Annotation type member

Controls whether a blank space should be printed before the left parenthesis annotation type members.

Example 2.487. Annotation type member

@interface MyAnnotation {
    String value();
}

Example 2.488. Annotation type member with space left paren

@interface MyAnnotation {
    String value ();
}

Enum constant argument

Controls whether a blank space should be printed before the left parenthesis of enum constant argument lists.

Example 2.489. Enum constant

enum MyEnum {
    GREEN(0,255,0)
}

Example 2.490. Enum constant with space before left parenthesis

enum MyEnum {
    GREEN (0,255,0)
}

Declaration parameter

Controls whether a blank space will be printed before the left parenthesis of method and/or constructor parameter lists.

Constructor

Control whether a blank space will be printed before the left parenthesis of constructor parameter lists.

Example 2.491. Constructor declaration

Foo(int p1,int p2,int p3) {
}

Example 2.492. Constructor declaration with space before left parenthesis

Foo (int p1,int p2,int p3) {
}

Method

Control whether a blank space will be printed before the left parenthesis of method parameter lists.

Example 2.493. Method declaration

public void foo(int p1,int p2,int p3) {
}

Example 2.494. Method declaration with space before left parenthesis

public void foo (int p1,int p2,int p3) {
}

Statement expressions

Lets you control whether a blank space will be printed before the left parenthesis of statement expressions.

if

Lets you control whether a blank space will be printed before the left parenthesis of if expressions.

Example 2.495. if statement

if(condition) {
}

Example 2.496. if statement with space before left parenthesis

if (condition) {
}

for

Lets you control whether a blank space will be printed before the left parenthesis of for expressions.

Example 2.497. for statement

for(String s : names) {
}

Example 2.498. for statement with space before left parenthesis

for (String s : names) {
}

while

Lets you control whether a blank space will be printed before the left parenthesis of while expressions.

Example 2.499. while statement

while(condition) {
}

Example 2.500. while statement with space before left parenthesis

while (condition) {
}

switch

Lets you control whether a blank space will be printed before the left parenthesis of switch expressions.

Example 2.501. switch statement

switch(c) {
}

Example 2.502. switch statement with space before left parenthesis

switch (c) {
}

throw

Lets you control whether a blank space will be printed before the left parenthesis of throw expressions.

Example 2.503. throw statement

throw(new UnsupportOperationException());

Example 2.504. throw statement with space before left parenthesis

throw (new UnsupportOperationException());

synchronized

Lets you control whether a blank space will be printed before the left parenthesis of synchronized expressions.

Example 2.505. synchronized statement

synchronized(this) {
    performOperation();
}

Example 2.506. synchronized statement with space before left parenthesis

synchronized (this) {
    performOperation();
}

catch

Lets you control whether a blank space will be printed before the left parenthesis of catch expressions.

Example 2.507. catch statement

try {
    Integer.parseInt(value);
} catch(NumberFormatException ex) {
}

Example 2.508. catch statement with space before left parenthesis

try {
    Integer.parseInt(value);
} catch (NumberFormatException ex) {
}

return

Lets you control whether a blank space will be printed before the left parenthesis of return expressions.

Example 2.509. return statement

return(200 + (a * b));

Example 2.510. return statement with space before left parenthesis

return (200 + (a * b));

Call arguments

Controls whether a blank space will be printed before the left parenthesis of call arguments.

Constructor

Controls whether a blank space will be printed before the left parenthesis of constructor call arguments.

Example 2.511. Constructor call

Foo(int p1,int p2,int p3){
    super(p1,true);
}

Example 2.512. Constructor call with space before left parenthesis

Foo(int p1,int p2,int p3){
    super (p1,true);
}

Method

Controls whether a blank space will be printed before the left parenthesis of method call arguments.

Example 2.513. Method call

test(x,y);

Example 2.514. Method call space with space before left parenthesis

test (x,y);

Creator

Controls whether a blank space will be printed before the left parenthesis of creator call arguments.

Example 2.515. Creator call

Point point=new Point(x,y);

Example 2.516. Creator call with space before left parenthesis

Point point=new Point (x,y);

2.7.8.1.16. After left parenthesis

Lets you specify what left parentheses should have a blank space printed after.

Annotation argument list

Controls whether a blank space should be printed after the left parenthesis of annotation argument lists.

Example 2.517. Annotation

@Annot(x=23,y=-3)
class Foo {
}

Example 2.518. Annotation with space after left parenthesis

@Annot( x=23,y=-3)
class Foo {
}

Enum constant argument

Controls whether a blank space should be printed after the left parenthesis of enum constant argument lists.

Example 2.519. Enum constant

enum MyEnum {
    GREEN(0,255,0)
}

Example 2.520. Enum constant with space after left parenthesis

enum MyEnum {
    GREEN( 0,255,0)
}

Declaration parameter

Controls whether a blank space will be printed after the left parenthesis of method and/or constructor parameter lists.

Constructor

Control whether a blank space will be printed after the left parenthesis of constructor parameter lists.

Example 2.521. Constructor declaration

Foo(int p1,int p2,int p3) {
}

Example 2.522. Constructor declaration with space after left parenthesis

Foo( int p1,int p2,int p3) {
}

Method

Control whether a blank space will be printed after the left parenthesis of method parameter lists.

Example 2.523. Method declaration

public void foo(int p1,int p2,int p3) {
}

Example 2.524. Method declaration with space after left parenthesis

public void foo( int p1,int p2,int p3) {
}

Statement expressions

Lets you control whether a blank space will be printed before the left parenthesis of statement expressions.

if

Lets you control whether a blank space will be printed after the left parenthesis of if expressions.

Example 2.525. if statement

if(condition) {
}

Example 2.526. if statement with space after left parenthesis

if( condition) {
}

for

Lets you control whether a blank space will be printed after the left parenthesis of for expressions.

Example 2.527. for statement

for(String s : names) {
}

Example 2.528. for statement with space after left parenthesis

for( String s : names) {
}

while

Lets you control whether a blank space will be printed after the left parenthesis of while expressions.

Example 2.529. while statement

while(condition) {
}

Example 2.530. while statement with space after left parenthesis

while( condition) {
}

switch

Lets you control whether a blank space will be printed after the left parenthesis of switch expressions.

Example 2.531. switch statement

switch(c) {
}

Example 2.532. switch statement with space after left parenthesis

switch( c) {
}

throw

Lets you control whether a blank space will be printed after the left parenthesis of throw expressions.

Example 2.533. throw statement

throw(new UnsupportOperationException());

Example 2.534. throw statement with space after left parenthesis

throw( new UnsupportOperationException());

synchronized

Lets you control whether a blank space will be printed after the left parenthesis of synchronized expressions.

Example 2.535. synchronized statement

synchronized(this) {
    performOperation();
}

Example 2.536. synchronized statement with space after left parenthesis

synchronized( this) {
    performOperation();
}

catch

Lets you control whether a blank space will be printed after the left parenthesis of catch expressions.

Example 2.537. catch statement

try {
    Integer.parseInt(value);
} catch(NumberFormatException ex) {
}

Example 2.538. catch statement with space after left parenthesis

try {
    Integer.parseInt(value);
} catch( NumberFormatException ex) {
}

return

Lets you control whether a blank space will be printed after the left parenthesis of return expressions.

Example 2.539. return statement

return(200 + (a * b));

Example 2.540. return statement with space after left parenthesis

return( 200 + (a * b));

Call arguments

Controls whether a blank space will be printed after the left parenthesis of call arguments.

Constructor

Controls whether a blank space will be printed after the left parenthesis of constructor call arguments.

Example 2.541. Constructor call

Foo(int p1,int p2,int p3){
    super(p1,true);
}

Example 2.542. Constructor call with space after left parenthesis

Foo(int p1,int p2,int p3){
    super( p1,true);
}

Method

Controls whether a blank space will be printed after the left parenthesis of method call arguments.

Example 2.543. Method call

test(x,y);

Example 2.544. Method call space with space after left parenthesis

test( x,y);

Creator

Controls whether a blank space will be printed after the left parenthesis of creator call arguments.

Example 2.545. Creator call

Point point=new Point(x,y);

Example 2.546. Creator call with space after left parenthesis

Point point=new Point( x,y);

Parenthesized expression

Controls whether a blank space will be printed after the left parenthesis of parenthesized expressions..

Example 2.547. Expression

int r = (a * (b + c + d) * (e + f));

Example 2.548. Expression with space after left parenthesis

int r = ( a * ( b + c + d) * ( e + f));

Type cast

Controls whether a blank space will be printed after the left parenthesis of type casts.

Example 2.549. Type cast

LineManager m = (LineManager)a.getParent();

Example 2.550. Type cast with space after left parenthesis

LineManager m = ( LineManager)a.getParent();

2.7.8.1.17. Before right parenthesis

Lets you specify what right parentheses should have a blank space printed before.

Annotation argument list

Controls whether a blank space should be printed before the right parenthesis of annotation argument lists.

Example 2.551. Annotation

@Annot(x=23,y=-3)
class Foo {
}

Example 2.552. Annotation with space before right parenthesis

@Annot(x=23,y=-3 )
class Foo {
}

Enum constant argument

Controls whether a blank space should be printed before the right parenthesis of enum constant argument lists.

Example 2.553. Enum constant

enum MyEnum {
    GREEN(0,255,0)
}

Example 2.554. Enum constant with space before right parenthesis

enum MyEnum {
    GREEN(0,255,0 )
}

Declaration parameter

Controls whether a blank space will be printed after the left parenthesis of method and/or constructor parameter lists.

Constructor

Control whether a blank space will be printed before the right parenthesis of constructor parameter lists.

Example 2.555. Constructor declaration

Foo(int p1,int p2,int p3) {
}

Example 2.556. Constructor declaration with space before right parenthesis

Foo(int p1,int p2,int p3 ) {
}

Method

Control whether a blank space will be printed before the right parenthesis of method parameter lists.

Example 2.557. Method declaration

public void foo(int p1,int p2,int p3) {
}

Example 2.558. Method declaration with space before right parenthesis

public void foo(int p1,int p2,int p3 ) {
}

Statement expressions

Lets you control whether a blank space will be printed before the left parenthesis of statement expressions.

if

Lets you control whether a blank space will be printed before the right parenthesis of if expressions.

Example 2.559. if statement

if(condition) {
}

Example 2.560. if statement with space before right parenthesis

if(condition ) {
}