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 - Broken opening brace indentation when editing Java code
Summary: Broken opening brace indentation when editing Java code
Status: RESOLVED DUPLICATE of bug 192033
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P1 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-17 13:59 UTC by chrysophylax
Modified: 2010-11-18 08:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***