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

Bug 471282

Summary: [formatter] JavaDoc formatter removes blank lines before tags
Product: [Eclipse Project] JDT Reporter: Christian Rösch <eclipse>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: eclipse, mateusz.matela
Version: 4.5   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Christian Rösch CLA 2015-06-29 05:01:45 EDT
Migrating to Mars I found some unexpected behaviour of the code formatter.

I checked my settings and it seems that "Blank line before JavaDoc tags" has no effect. Not even in the preview window. Same with "New line after @param tags".

I have the following JavaDoc comment:

<pre>
  /**
   * Some text.
   *
   * @param param1 describes the first argument
   * @param param2 describes the second argument
   *
   * @return even a return value is available.
   */
</pre>

With the above two settings set I would expect the new formatter to keep the formatting. But instead it does:

<pre>
  /**
   * Some text.
   * @param param1 describes the first argument
   * @param param2 describes the second argument
   * @return even a return value is available.
   */
</pre>

Did I miss something?
Comment 1 Christian Rösch CLA 2015-06-29 05:05:56 EDT
Okay, I'm not sure about the line between @param and @return. Was it really done via "New line after @param tags"? I assume not. So let's concentrate on the new line before the JavaDoc tags :)
Comment 2 Mateusz Matela CLA 2015-07-08 18:53:39 EDT
The "Blank line before JavaDoc tags" option works for me, even with "Remove blank lines" enabled. Maybe some other option affects it in your case. Please attach your full formatter configuration.

I think @return doesn't need to be separated with additional blank line (unless you disable "Remove blank lines", then it shouldn't be removed).

"New line after @param tags" means new line between parameter's name and description.

BTW, bugzilla doesn't understand <pre> tags. For a moment I thought you have a comment inside a <pre> section in another comment :)
Comment 3 Mateusz Matela CLA 2015-12-28 19:49:23 EST
Please reopen if you can provide a formatter profile or workspace preferences that will allow me to reproduce the issue starting with a fresh workspace.