Bug 239130 - [formatter] Comment formatter does not keep blank lines after @see references
Summary: [formatter] Comment formatter does not keep blank lines after @see references
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M4   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 96696 196124 (view as bug list)
Depends on: 198074
Blocks:
  Show dependency tree
 
Reported: 2008-07-01 10:36 EDT by Frederic Fusier CLA
Modified: 2008-12-09 14:01 EST (History)
3 users (show)

See Also:


Attachments
Proposed patch (29.46 KB, patch)
2008-12-03 07:13 EST, Frederic Fusier CLA
no flags Details | Diff
Updated patch on top of fix for bug 256799 (29.09 KB, patch)
2008-12-04 06:30 EST, Frederic Fusier CLA
no flags Details | Diff
Last proposed patch (30.00 KB, patch)
2008-12-04 11:31 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 2008-07-01 10:36:12 EDT
Using 3.4.0

Formatting the following simple test case:
public class X {

	/**
	 * @see java.lang.String
	 * 
	 * Formatter should keep empty line above
	 */
	void foo() {
	}
}

I get the following output:
public class X {

	/**
	 * @see java.lang.String Formatter should keep empty line above
	 */
	void foo() {
	}
}

Which is obviously incorrect. This output should only be produced if the 'Remove blank lines' preference was set in the 'Comment' tab...
Comment 1 Olivier Thomann CLA 2008-07-07 11:36:20 EDT
(In reply to comment #0)
> Which is obviously incorrect. This output should only be produced if the
> 'Remove blank lines' preference was set in the 'Comment' tab...
If this option is set, the output should be:
public class X {

        /**
         * @see java.lang.String
         * Formatter should keep empty line above
         */
        void foo() {
        }
} 

and not:
public class X {

        /**
         * @see java.lang.String Formatter should keep empty line above
         */
        void foo() {
        }
} 
Comment 2 Frederic Fusier CLA 2008-07-08 07:54:57 EDT
(In reply to comment #1)
Theoretically yes, but due to bug 96696 it would behave like I described (i.e. concatenating lines). Currently the formatter does not preserve existing line breaks, neither in comments (bug 96696) nor in code (bug 198074).

I think we need to think about a global solution which would solve all these bugs in one shot...
Comment 3 Frederic Fusier CLA 2008-12-03 07:13:37 EST
Created attachment 119368 [details]
Proposed patch

This patch also includes fix for bug 198074 as there's only one preference to preserve existing line break...
Comment 4 Frederic Fusier CLA 2008-12-03 07:16:28 EST
*** Bug 96696 has been marked as a duplicate of this bug. ***
Comment 5 Frederic Fusier CLA 2008-12-03 07:18:22 EST
*** Bug 196124 has been marked as a duplicate of this bug. ***
Comment 6 Frederic Fusier CLA 2008-12-04 06:30:17 EST
Created attachment 119490 [details]
Updated patch on top of fix for bug 256799
Comment 7 Frederic Fusier CLA 2008-12-04 11:31:33 EST
Created attachment 119523 [details]
Last proposed patch

This last patch includes an expected change in an existing test...
Comment 8 Frederic Fusier CLA 2008-12-04 11:39:48 EST
Released for 3.5M4 in HEAD stream.
Comment 9 Kent Johnson CLA 2008-12-09 14:01:16 EST
Verified for 3.5M4 using I20081209-0100