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 250281 - Comments in [java] switch statement inappropriately wrapping on reformat.
Summary: Comments in [java] switch statement inappropriately wrapping on reformat.
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.0.2
Hardware: Other Linux
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-06 22:36 UTC by naquada
Modified: 2015-02-16 10:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Export of Editor and Formatting prefs (127.88 KB, application/x-zip-compressed)
2015-02-06 22:36 UTC, naquada
Details

Note You need to log in before you can comment on or make changes to this bug.
Description naquada 2015-02-06 22:36:37 UTC
Created attachment 151872 [details]
Export of Editor and Formatting prefs

If you format this source (first listing) with menu Source -> Format, the result contains an inappropriate line break/wrap in the result with these options:
  Right Margin: 100
  Enable Comments Formatting: yes
  Format Block Comments: yes
  Add Leading Star: yes
  Wrap Text at Right Margin: yes
  Wrap One Line Comments: no
  Preserve New Lines: yes

I've attached an export of the Editor and Formatting preferences.

---------------------------------------------------------------------------
public class SwitchFormat
{
  public void fn(int i)
  {
    switch (i) {
      case 1:
        /* In this case we want to do something that is associated with a value of 1 */
        break;
      default:
      /* Other stuff */
    }
  }
}
---------------------------------------------------------------------------
You get this:
---------------------------------------------------------------------------
public class SwitchFormat
{
  public void fn(int i)
  {
    switch (i) {
      case 1:
        /* In this
         * case we want to do something that is associated with a value of 1 */
        break;
      default:
      /* Other stuff */
    }
  }
}
---------------------------------------------------------------------------
Notice how the comment in "case 1" has wrapped, unnecessarily.