Empty braces

Controls how empty braces should be printed.

Cuddle braces

Prints both braces on one line right after the declaration or statement.

Example 2.91. Cuddled empty braces

class Foo {

    public void foo() { }
}

You can control the amount of white space that is printed before the left curly brace. See “Cuddled braces indent” for more information.

Obey brace style

Causes the left curly brace of the empty brace block to be positioned according to the current brace style settings. Depending on the style, the left brace is either printed directly after an element or will have a line break printed before. This option is only available when the section called “Cuddle braces” is enabled.

Since 1.7

Example 2.92. Cuddled braces, C brace style

class Foo
{

    public void foo() { }
}

Example 2.93. Cuddled braces, C brace style, obey brace style

class Foo
{

    public void foo()
    { }
}

Insert empty statement

Inserts an empty statement to make it obvious for the reader that the empty braces are intentional. Please note that this option does not apply for class/interface and method/constructor bodies, but is only used for control statements and blocks.

Example 2.94. Empty braces with empty statement

class Foo {

    public void foo() {
        ;
    }
}