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.
1. Goto Tools >> Options >> Formatting >> Languages: Java, Category: Comments. The option "Add Leading Star" should be checked and "Format Block Comments" should be unchecked. 2. Type /* and press Enter Results: /* */ Expected: /* * */ This works in NetBeans 7.3.1. Product Version: NetBeans IDE Dev (Build 201308240953) Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b55 Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b40 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Current behavior is as designed. Block comment formatting settings should be respected - when "Format Block Comments" is unchecked, no formatting of block comments should be done - including adding of leading star.
Leading stars has _always_ worked in 7.2 and 7.3 and the preview in 7.4 shows leading stars without formatting blocks. Is there a workaround so that I can have automatic leading stars and not have format messing up code that I have in comments? I will be happy to open or change this to an ENHANCEMENT or maybe there is a better solution to have formatted comments while avoiding format of code in comments?
Here is what I mean, with block formatting on I get auto-leading stars, but if I format this: /* * public void test(int[] array) { * for (int i = 0; i < array.length; i++) { * int j = array[i]; * } * } */ I get this: /* * public void test(int[] array) { for (int i = 0; i < array.length; i++) { * int j = array[i]; } } */ Which is a problem for me. If I disable formatting blocks, it won't do this, but then I can't easily type block comments with auto-leading stars.
Anyway, I think it should behave like it does now too, for consistency in the options, so I think what I need should be an additional option so it's clear that the option only adds leading star. Or an option that prevents code in blocks from being formatted while block comment formating is enabled.
Changed to ENHANCEMENT
So, anybody got a workaround?