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 268159 - Expand tabs to spaces does not process single-line comments
Summary: Expand tabs to spaces does not process single-line comments
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: Dev
Hardware: PC Windows 10 x64
: P3 normal (vote)
Assignee: Dusan Balek
Depends on:
Reported: 2016-09-22 18:19 UTC by _ gtzabari
Modified: 2016-09-22 18:20 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2016-09-22 18:19:59 UTC
Product Version: NetBeans IDE Dev (Build 201609200002)
Java: 1.8.0_102; Java HotSpot(TM) 64-Bit Server VM 25.102-b14
Runtime: Java(TM) SE Runtime Environment 1.8.0_102-b14
System: Windows 10 version 10.0 running on amd64; UTF-8; en_US (nb)
User directory: C:\Users\a-gtzabari\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\a-gtzabari\AppData\Local\NetBeans\Cache\dev

1. Create Java project with "Expand tabs to spaces" disabled
2. Given:

class Test
  public static void main(String[] args)
    int test = 5;

3. Place the caret on "test=5" and hit CTRL+/ to comment-out the line.
4. Now, go into formatting options and enable "Expand tabs to spaces"
5. Now, hit CTRL+F to reformat the file.
6. Notice that tabs got converted to spaces everywhere except in the commented-out line.

Expected behavior: Tabs should be converted to spaces inside comments.

Reasoning: When migrating existing code to a project with different checkstyle rules I am forced to use spaces for indentation. Converting the indentation manually for comments is very labour-intensive.