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.
In certain situations, the editor generates a wrong indentation. Example #1 ("|" denotes the caret position): public class Example { void foo() { try { // ... }| finally { // ... } } } When pressing Return to insert a catch block, the result is: public class Example { void foo() { try { // ... } | finally { // ... } } } I.e. an indentation is added, which doesn't make sense here. Example #2: public class Example { private static final String[] STRINGS = new String[]| } Pressing Return followed by "{" results in: public class Example { private static final String[] STRINGS = new String[] {| } (In 6.9., typing the "{" would remove the indent.) ...and then pressing Return to auto-generate the closing brace results (correctly, but inconsistent to the opening brace) in: public class Example { private static final String[] STRINGS = new String[] { | } } The same happens after "new Runnable()" (i.e. the start of an anonymous class). This is a regression from NB 6.9.
Another situation where this happens is when pressing Return after an annotation, e.g. after "@Override", an indentation is inserted.
Fixed in jet-main. http://hg.netbeans.org/jet-main/rev/486478976f2d
Integrated into 'main-golden', will be available in build *201104010400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/486478976f2d User: Dusan Balek <dbalek@netbeans.org> Log: Issue #197047: Wrong smart indentation (regression from 6.9) - fixed.