Bug 295238

Summary: [formatter] The comment formatter add an unexpected new line in block comment
Product: [Eclipse Project] JDT Reporter: Frederic Fusier <frederic_fusier>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: satyam.kandula, srikanth_sankaran
Version: 3.6   
Target Milestone: 3.6 M4   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Test case to reproduce the problem
none
Proposed patch
none
New proposed patch none

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