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 123414

Summary: Code-format incorrect removal of braces
Product: editor Reporter: richwilsonaus <richwilsonaus>
Component: Formatting & IndentationAssignee: issues@editor <issues>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P2    
Version: 6.x   
Hardware: All   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:

Description richwilsonaus 2007-12-05 03:27:37 UTC
If the desired code formatting is to remove braces where not required for "if" statements (Tools.. Options.. Java 
Code.. Formatting.. Braces Generation, "if" set to "Eliminate") the following code:

    if (a) {
      if (b) {
        
      }
    }
    else { // !a
      
    }

will have the logic changed after formatting to:

    if (a)
      if (b) {

      }
    else { // !a   (- Now a && !b)

    }

This bug has destroyed the logic in a number of my source files.
Comment 1 Jiri Prox 2007-12-05 07:49:43 UTC
This is already filed. Thanks for your report anyway

*** This issue has been marked as a duplicate of 123258 ***