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.

Bug 192056

Summary: Broken opening brace indentation when editing Java code
Product: java Reporter: chrysophylax
Component: EditorAssignee: Dusan Balek <dbalek>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P1    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:

Description chrysophylax 2010-11-17 13:59:58 UTC
This came with latest Netbeans update to 6.9.1 build 201011082200. Before that update, indentation was working as expected.

I'm editing Java code. Tools -> Options -> Formatting, Language(Java), Category(Braces): Class declaration, method declaration and other all set to "new line".

The problem is indentation of "{" brace on a new line. As I'm typing the code gets formatted as follows:


class A
{
    void a()
            {
        boolean b;
        if(b)
            {
            
        } else if(b)
            {
            
        }
        else
            {
            
        }
    }
}

Please note the "{" brace got correctly indented for "Class A" and wrong in all other cases.

Then, when I select above code and press Alt+Shift+F (autoformatting) I get:


class A
{

    void a()
    {
        boolean b;
        if (b)
        {
        }
        else if (b)
        {
        }
        else
        {
        }
    }
}

which is correct output.

This is a bad bug and renders Java editing feature unusable in many aspects. Please investigate it.
Comment 1 Dusan Balek 2010-11-18 08:02:39 UTC
Already reported. Thanks.

*** This bug has been marked as a duplicate of bug 192033 ***