Bug 360523 - Whitespace after empty javadoc lines when autoformat and remove trailing spaces are both enabled
Summary: Whitespace after empty javadoc lines when autoformat and remove trailing spac...
Status: CLOSED DUPLICATE of bug 251824
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8   Edit
Hardware: PC Linux
: P3 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact: Ayushman Jain CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-11 05:55 EDT by Sei Syvalta CLA
Modified: 2018-06-11 12:19 EDT (History)
12 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sei Syvalta CLA 2011-10-11 05:55:33 EDT
Build Identifier: Eclipse Java EE IDE for Web Developers, Version: Indigo Service Release 1, Build id: 20110916-0149

Under "Java" - "Editor" - "Save Actions", enable:
- Perform selected actions on save
 - Format source code
  - Format all lines
- Additional actions
 - Remove trailing white spaces on all lines

This results in empty spaces after empty javadoc lines.

The end result is that if you use "format on save" action you cannot prevent
the trailing spaces of appearing (perhaps because of the order the actions are
executed).

There seems to be discussion about the issue also in stackoverflow:
http://stackoverflow.com/questions/7008340/eclipse-formatter-adds-space-in-empty-comment-lines


Reproducible: Always

Steps to Reproduce:
As described above.
Comment 1 Ayushman Jain CLA 2011-10-11 09:55:18 EDT
Will investigate once bug 303519 is fixed.

This happens because by default the formatter adds one space after each line inside the javadoc comment. If this is annoying, you can consider turning off the javadoc comments formatting (in Preferences>Java>Code style>Formatter>Comments).
Comment 2 Palmer Eldritch CLA 2012-10-03 22:47:29 EDT
This is annoying but turning off the formatting of the comments would be more annoying (it does a very good job). Could be fixed by having the removal of trailing spaces to be performed LAST
Comment 3 Johannes Wienke CLA 2013-07-04 08:29:15 EDT
This is actually getting more and more important with the increasing use of git, as trailing spaces are considered bad in git.
Comment 4 Dani Megert CLA 2013-09-13 03:08:36 EDT

*** This bug has been marked as a duplicate of bug 251824 ***