Eclipse formatter adds space in empty comment lines

Elbonian picture Elbonian · Aug 10, 2011 · Viewed 13.7k times · Source

The eclipse code formatter adds a trailing space in each empty Javadoc comment line (see screenshot).

enter image description here

The formatter of a colleague is always removing those spaces (and thus producing annoying SVN diffs). He is claiming to use the same formatter settings (XML file). Nevertheless, I tried all the options in the comments tab of the formatter settings page - without success.

Can it be a difference between eclipse versions? (I am using Springsource Tool Suite 2.7.1, which is based on Helios, I believe)

Answer

ZhekaKozlov picture ZhekaKozlov · Dec 10, 2012

Go to Preferences -> Java -> Editor -> Save actions and select Format edited lines.

After applying changes all trailing whitespaces in Javadoc will be removed

Note: "Additional actions"->"Remove trailing white space on all lines" must also be enabled.