This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The style of indentation where the braces line up with the code in the inner block (i.e. are themselves indented) is not supported by the Java indentation engine. This could be added by adding an option for "add extra tab ebfore opening and closing braces". Without this option it is necessary to manually add tabs before the automatically inserted braces.
Can you provide some example, please?
The style of indenting that Netbeans supports: for (int j = 0; j < 10; j++) { // Statements indented to here Braces in line with outer block r = 10; } The coding style in use in many companies: for (int j = 0; j < 10; j++) { // Statements indented to here Braces in line with INNER code r = 10; } For some reason Java style guides specify the first type - and that is all the Java indentation engine supports. However the second type makes it easier to find the braces that enclose the statements - and is a style mandated by many organizations.
I'd like to request an option for: for (int j = 0; j < 10; j++) { // Statements indented to here Braces in line with INNER code r = 10; } This could be expressed either as: 1. indent braces, and then indent code inside braces again (indent=2), or 2. indent braces by only half an indent (indent=4).
Both way of formatting will be supported in upcoming 6.0 version