Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351373 - Bug in "align fields in columns" Formatter with inline comments
Summary: Bug in "align fields in columns" Formatter with inline comments
Status: RESOLVED DUPLICATE of bug 303519
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: 4.8 M6   Edit
Assignee: Mateusz Matela CLA
QA Contact: Ayushman Jain CLA
URL:
Whiteboard: To be verified for 4.8 M6
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-06 17:00 EDT by NemoStein CLA
Modified: 2018-03-08 03:41 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description NemoStein CLA 2011-07-06 17:00:18 EDT
When formating multiple fields with "align fields in columns" checked and with comments at the end of the line, depending on the number of characters in that line, the comment comes one tab back.

Assume the following code:

public String A = "1"; // a
public String B = "22"; // b
public String C = "333"; // c
public String D = "4444"; // d


When applying formatting, this is what I expect as formated output:

public String	A	= "1";		// a
public String	B	= "22";		// b
public String	C	= "333";	// c
public String	D	= "4444";	// d


But this is the formated output that I receive:

public String	A	= "1";		// a
public String	B	= "22";	// b
public String	C	= "333";	// c
public String	D	= "4444";	// d


if you increase or decrease in one the number of characters in the value part (the string itself) the formatting works like expected.

public String	A	= "1";		// x
public String	B	= "12";	// y
public String	C	= "123";	// z
Comment 1 NemoStein CLA 2011-07-06 17:06:56 EDT
As I can see, the formating of the code broke.
This is the link to the original post, where you can see the formatting:
http://www.eclipse.org/forums/index.php/m/692967/#msg_692967
Comment 2 Ayushman Jain CLA 2011-07-06 22:27:58 EDT
Will investigate, time permitting.
Comment 3 NemoStein CLA 2012-03-21 12:22:23 EDT
Bug persists in Indigo 3.7.2
Comment 4 Mateusz Matela CLA 2018-02-05 16:48:17 EST
This problem no longer occurs after the formatter redesign.

*** This bug has been marked as a duplicate of bug 303519 ***
Comment 5 Manoj N Palat CLA 2018-03-08 03:41:59 EST
Verified for Eclipse Photon (4.8) M6 with Build id: I20180306-0800