Bug 295238 - [formatter] The comment formatter add an unexpected new line in block comment
Summary: [formatter] The comment formatter add an unexpected new line in block comment
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.6 M4   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-16 07:43 EST by Frederic Fusier CLA
Modified: 2009-12-08 04:39 EST (History)
2 users (show)

See Also:


Attachments
Test case to reproduce the problem (240 bytes, text/java)
2009-11-16 07:43 EST, Frederic Fusier CLA
no flags Details
Proposed patch (3.58 KB, patch)
2009-11-16 07:51 EST, Frederic Fusier CLA
no flags Details | Diff
New proposed patch (7.44 KB, patch)
2009-11-16 12:48 EST, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2009-11-16 07:43:09 EST
Created attachment 152291 [details]
Test case to reproduce the problem

Build I20091110-0800 but happens since the 'Never join lines' preference has
been added (i.e. 3.5.0)

Consider the test case attached to this bug, format several times it using
Eclipse built-in profile + 'Never join lines' preference checked on comment...

A new line is always added after the @see tag line, hence makes the formatter
unstable!
Comment 1 Frederic Fusier CLA 2009-11-16 07:51:40 EST
Created attachment 152292 [details]
Proposed patch

With this patch the number of unstable formatting decrease from 526 to 4 on the Eclipse 3.0 full source workspace... :-)
Comment 2 Frederic Fusier CLA 2009-11-16 12:48:40 EST
Created attachment 152322 [details]
New proposed patch

Previous patch was missing one place to set the added bufferHasNewLine local variable. Note that it also adds similar missing set for the already existing bufferHasTokens local variable (see test cases b2 and b3)...
Comment 3 Frederic Fusier CLA 2009-11-16 13:33:44 EST
Released for 3.6M4 in HEAD stream.
Comment 4 Satyam Kandula CLA 2009-12-08 04:11:51 EST
Verified for 3.6M4 using I20091207-1800