Cannot remove block comment in Eclipse after formatting
eclipse, formatting
Solution
This may be a little late in the game, but I fixed this by disabling block comment formatting.
Windows -> Preferences -> Java -> Code Style -> Formatter -> Edit -> Comments
Then uncheck Enable block comment formatting.
Problem
Eclipse's automatic formatter changes block comments such that the Source > Remove Block Comment does not completely remove the block comment. Source > Add Block Comment adds the start and end of the clock comment to the lines of code, but after running the Formatter (Ctrl + Shift + F), it wraps the lines of code and adds an asterisk to the start of each line. When I try to remove the block comment with Source > Remove Block Comment, the start and end of the block comment is removed, but the asterisks at the beginning of each line is not removed. How do I prevent Eclipse from adding these asterisks, or remove the asterisks when it removes the start and end of the block comment? Example: Code like this: ``` String abc="abc"; String def="def"; System.out.println(abc+def); System.exit(0); ``` Becomes like this after adding block comments: ``` /* String abc="abc"; String def="def"; System.out.println(abc+def); */ System.exit(0); ``` Which becomes like this after applying formatting: ``` /* * String abc="abc"; String def="def"; System.out.println(abc+def); */System.exit(0); ``` Which ends up like this after using the Remove Block Comment function: ``` * String abc="abc"; String def="def"; System.out.println(abc+def); System.exit(0); ```