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 258097 - Special if else treatment - format code jumps
Summary: Special if else treatment - format code jumps
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-22 14:52 UTC by dboldureanu
Modified: 2016-02-22 14:52 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 dboldureanu 2016-02-22 14:52:14 UTC
The code:

    if (true)
    {
      System.out.println("1");
    }
    else // A comment
     if (true)
      {
        System.out.println("2");
      }

when formatted (Source->Format, Alt+Shift+F) will jump to 

    if (true)
    {
      System.out.println("1");
    }
    else // A comment
    {
      if (true)
      {
        System.out.println("2");
      }
    }

and back forever! The jump is determined by the presence of the comment after else ("// A comment").