The eclipse code formatter adds a trailing space in each empty Javadoc comment line (see screenshot).
I found that if you go to Preferences → Java → Editor → Content Assist → Save Actions
the following configuration works most of the time:
(That is to say, turn off the Format source code
option in Save Actions
, but keep the Remove trailing white spaces on all lines
in Additional actions
on.)
The formatter and save actions duke it out, but save actions seems to win most of the time. The downside of this is that you need to periodically manually format the code.
This is using Eclipse Juno.
see https://bugs.eclipse.org/bugs/show_bug.cgi?id=360523 for a possible workaround.
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.
I've also had this issue and solved it by doing a Search/Replace in Eclipse.
^([\s]+\*)([\s]+)$
into the Containing text field.What this is doing is searching for lines that start with blank space characters that contain a * and then further blank space and no other content. It then replaces the whole line with the first matched part of the regex, which is just the initial spacing and * of the comment line.