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

Bug 100771

Summary: [typing] Blank line without whitespace causes javadoc indentation oddity
Product: [Eclipse Project] JDT Reporter: David Saff <david>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P4    
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description David Saff CLA 2005-06-20 05:05:03 EDT
In RC3.

Given code:

	/**	 

	 * oops, extra return there.
	 */
	public static String noop() {
		return "";
	}

(Note there is no whitespace on the blank line).  Place the cursor on "oops" and
use Source > Indent.  All the whitespace before the star is removed.

This is related to, but not the same as, bug 99135.  In that case, the whole
file was being indented, and there was whitespace in the previous line.  In this
case, there is no whitespace in the previous line, and only one line is being
indented.  This is a less likely case, so marking as minor.
Comment 1 Tom Hofmann CLA 2005-06-20 05:55:49 EDT
This is probably the correct thing to do - indenting a javadoc line indents it
like the previous javadoc line, in this case the empty line.

Not sure whether we trying to be smart here would be a good idea. The only
discriminator that would make sense would be to differentiate between
asterix-lines and non-asterix-lines.

If we add support for  the javadoc style introduced with 1.4 that allows code
snippets without leading asterix, we probably should also consider this.
Comment 2 David Saff CLA 2005-06-20 06:01:06 EDT
Smarter people have doubtlessly thought harder about this than I, but it seems
to me that the "right" place to indent an asterisked line of javadoc is to line
the asterisk with the leading /**, or at least the most recent asterisk.  This
seems to me consistent with the behavior of indenting Java code, where numerous
blank lines (with or without whitespace) between the current line and the line
containing the relevant opening brace are ignored.

However, I'm not prepared to argue much on this point.
Comment 3 Eclipse Genie CLA 2020-04-11 14:48:19 EDT
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.