Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 54627 - [formatter] Blank lines between Javadoc tags
Summary: [formatter] Blank lines between Javadoc tags
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P5 enhancement with 2 votes (vote)
Target Milestone: 4.14 M3   Edit
Assignee: Mateusz Matela CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 552888
  Show dependency tree
 
Reported: 2004-03-12 09:49 EST by Nobody - feel free to take it CLA
Modified: 2019-11-21 03:01 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nobody - feel free to take it CLA 2004-03-12 09:49:30 EST
Code Formatter:
There should be a way to set up the behaviour for every single Javadoc tag. 
E.g. "blank line before @return", "no blank line between tags of the same kind 
(as between @param and @param)", "blank line between different tags (as 
between @param and @return)", etc.
Comment 1 Dani Megert CLA 2004-03-16 04:55:32 EST
not for 3.0
Comment 2 Nobody - feel free to take it CLA 2004-03-22 06:36:07 EST
For 3.0, could you please at least add the option "blank line between 
different tags" (as between @param and @return, @return and @throws), or make 
this preference the default without an option?

I think, this is what most people format their comments like and as far as I 
know, this is how Sun suggests to do it.

The missing lines really bother me heavily.
Comment 3 Dani Megert CLA 2005-10-10 12:15:03 EDT
Ownership changed.
Comment 4 Frederic Fusier CLA 2008-08-18 08:06:29 EDT
Ownership has changed for the formatter, but I surely will not have enough time to fix your bug during the 3.5 development process, hence set its priority to P5.
Please provide a patch if you definitely need the bug to be fixed in this version and I'll have a look at it...
TIA
Comment 5 Paul Benedict CLA 2018-10-17 12:19:08 EDT
I almost created a new bug :-) but luckily found this one in time. I believe there is good justification now to bump this ticket in priority....

JDK 8 introduced additional JavaDoc tags @apiNote, @implSpec and @implNote [1][2]. As demonstrated by the links and actual JDK source code [3], the preferred stylistic use of them is to place the tag annotation and the tag documentation on separate lines. 

Eclipse currently doesn't support this kind of formatting granularity. If it did, the "Blank line before Javadoc tags" option would be the right place for the enhancement. 

This request is to provide either an includes or excludes list by tag annotations.

Relevant links:
1) http://openjdk.java.net/jeps/8068562
2) https://bugs.openjdk.java.net/browse/JDK-8008632
3) http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/d9a44cfdeebf/src/java.base/share/classes/java/util/stream/Collectors.java
Comment 6 Paul Benedict CLA 2018-10-17 12:25:33 EDT
Addendum to comment #5: My preferred style is like the JDK source code, in which all tags (minus the aforementioned) are on the same line as the text. That's why this is an important request to me. In reverse, perhaps someone may find useful this enhancement for the opposite style.
Comment 7 Mateusz Matela CLA 2019-11-09 15:07:23 EST
(In reply to Paul Benedict from comment #5)
> I almost created a new bug :-) but luckily found this one in time. I believe
> there is good justification now to bump this ticket in priority....
> 
> JDK 8 introduced additional JavaDoc tags @apiNote, @implSpec and @implNote
> [1][2]. As demonstrated by the links and actual JDK source code [3], the
> preferred stylistic use of them is to place the tag annotation and the tag
> documentation on separate lines.

Well, you'll need to create a new bug then :)
This bug is not about adding a line break between a tag name and its description, it's about adding a blank line (as in two consecutive line breaks) between tags.


I'm going to implement the "blank line between tags of different type" option as suggested in comment 2.
Comment 8 Eclipse Genie CLA 2019-11-10 17:05:30 EST
New Gerrit change created: https://git.eclipse.org/r/152394
Comment 10 Manoj N Palat CLA 2019-11-21 03:01:20 EST
Verified for Eclipse Version: 2019-12 (4.14) M3 with Build id: I20191118-0600