Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 480359

Summary: Java formatter needs to break before paren encapsulating an inline tag
Product: [Eclipse Project] JDT Reporter: Terry Parker <tparker>
Component: CoreAssignee: Mateusz Matela <mateusz.matela>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: mateusz.matela
Version: 4.5   
Target Milestone: 4.6 M1   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Terry Parker CLA 2015-10-21 19:00:35 EDT
In the JGit project I added the equivalent of the following JavaDoc:
/** Walks all of the reachable commits via the branch tips ({@code peeledWants}), stores them in {@code commitsByOldest}. */

At 1 level of indentation, tabs set to 4 and a line length of 80, formatting the code in Eclipse 4.5.0 this breaks as follows:
	/**
	 * Walks all of the reachable commits via the branch tips (
	 * {@code peeledWants}), stores them in {@code commitsByOldest}.
	 */

Because the formatter breaks after the opening paren, the rendered output is "... ( peeledWants) ...". Note the extra space before between the opening paren and "peeledWants".
Comment 1 Mateusz Matela CLA 2015-12-25 08:46:12 EST
It was fixed for 4.6.
I guess it wasn't backported into 4.5.1 because it was quite an old bug, not something introduced by the new formatter.

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