Community
Participate
Working Groups
According to the Javadoc spec (relevant section: http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/javadoc.html#leadingasterisks): "... Starting with 1.4, if you omit the leading asterisk on a line, the leading white space is no longer removed. This enables you to paste code examples directly into a doc comment inside a <PRE> tag, and its indentation will be honored. Spaces are generally interpreted by browsers more uniformly than tabs. Indentation is relative to the left margin (rather than the separator /** or <PRE> tag)." Eclipse ignores this. So: /** This is a preformatted comment! */ becomes /** * This is a preformatted comment! */
According to the document (link posted in the inital comment) and the quoted text, this looks correct to me. The provided example is not a preformatted comment and should be formatted according to the current behavior. The question is, how should the following comment be formatted? /** This is comment <pre> with preformatted text! </pre> */ My suggestion: /** * This is a preformatted comment * <pre> with preformatted text! * </pre> */ Mhm.
One should be able to turn on/off this behavior. Personally I like the way that *'ses will added. If you want preformatting use <pre> ... and wait for bug 52921 get fixed.
Ownership changed.
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
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
Since the formatter redesign it works as suggested in comment 1. Keeping the whitespace without <pre>, as suggested in comment 0, doesn't make sense because the resulting javadoc will not show it anyway. Comment 2 suggested a setting for this and indeed there's no easy way to have asterisks added if a preformatted section was pasted without them. The fastest way I found is to toggle block selection mode to manually add asterisks in all lines. But that's a subject for another bug report. *** This bug has been marked as a duplicate of bug 303519 ***
Verified for 4.14 M3 using build I20191119-1250