Bug 29458 Templates for constructor
When I have an existing constructor within a class, which has a single line comment and I attempt to convert this comment to a multi lie comment, it inserts the 'typecomment' tempalte. In addition, the comment is not correctly indented. For example: before: /** * My typecomment */ public class MyClass { /** my constructor */ public MyClass() { } } after (placing cursor before 'my contructor' and hitting enter): /** * My typecomment */ public class MyClass { /** * My typecomment */ my constructor */ public MyClass() { } }
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocAutoIndentStrategy.java
int length= document.getLineDelimiter(line).length() + prefix.length();
					document.replace(c.offset, length, null);
					c.doit= false;
					c.length= 0;
					return;
				}
			
			} else if (document.getChar(c.offset - 1) == '*' && jdocExtractLinePrefix(document, line).length() - 1 >= c.offset - lineOffset) {
				lineDelimiter= document.getLineDelimiter(line - 1);
				String prefix= jdocExtractLinePrefix(document, line);
				int length= (lineDelimiter != null ? lineDelimiter.length() : 0) + prefix.length();
				document.replace(c.offset - length + 1, length, null);
				c.doit= false;
				c.offset -= length - 1;
				c.length= 0;
				return;
			} else {
				document.replace(c.offset, c.length, null);
				c.doit= false;
				c.length= 0;
			}
		} catch (BadLocationException e) {
			JavaPlugin.log(e);
		}
				
		try {
			int line= document.getLineOfOffset(c.offset);
			int lineOffset= document.getLineOffset(line);
			String prefix= jdocExtractLinePrefix(document, line);
			boolean always= c.offset > lineOffset && c.offset <= lineOffset + prefix.length();