Bug 237942 - [formatter] String references are put on next line when over the max line length
Summary: [formatter] String references are put on next line when over the max line length
Status: VERIFIED DUPLICATE of bug 233259
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.4.1   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-20 10:43 EDT by Frederic Fusier CLA
Modified: 2008-08-28 12:26 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2008-06-20 10:43:47 EDT
Using 3.4 candidate I20080617-2000.

Working on fix for bug 233259, I discovered that the comment formatter does not work properly with the string references.

The following test case:
public class Test {
        /**
         * @see "string reference: 01234567"
         * @see "string reference: 012345678"
         * @see "string reference: 01234567 90"
         * @see "string reference: 01234567890123"
         */
        void foo() {
        }
}

is formatted as follow using Eclipse built-in + 'max line width for comments'=40:
public class Test {
	/**
	 * @see "string reference: 01234567"
	 * @see 
	 *      "string reference: 012345678"
	 * @see 
	 *      "string reference: 01234567 90"
	 * @see 
	 *      "string reference: 01234567890123"
	 */
	void foo() {
	}
}
I would expect the string reference to stay on the same line than the @see tag...

Note that 3.3 formatter behavior is worst as it splits the string, hence producing a javadoc syntax error:
public class Test {
	/**
	 * @see "string reference: 01234567"
	 * @see "string reference:
	 *      012345678"
	 * @see "string reference: 01234567
	 *      90"
	 * @see "string reference:
	 *      01234567890123"
	 */
	void foo() {
	}
}
Comment 1 Frederic Fusier CLA 2008-06-24 09:07:26 EDT
This bug will be fixed by patch posted on bug 233259:
https://bugs.eclipse.org/bugs/attachment.cgi?id=105695

So, move the target to 3.4.1...
Comment 2 Frederic Fusier CLA 2008-06-24 09:17:20 EDT
Released for 3.5M1 in HEAD stream.
Comment 3 Frederic Fusier CLA 2008-06-25 07:24:54 EDT
There's no way to split bug 233259 patch to extract specific change which fixes this bug. So, set this bug as duplicate instead of dependent...


*** This bug has been marked as a duplicate of bug 233259 ***
Comment 4 Kent Johnson CLA 2008-08-06 15:00:47 EDT
Verified for 3.5M1 using I20080805-1307
Comment 5 Olivier Thomann CLA 2008-08-28 12:26:31 EDT
Verified for 3.4.1 using M20080827-2000