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
* Method jdocWrapParagraphFromLine.
	 * 
	 * @param document
	 * @param line
	 * @param always
	 */
	private void jdocWrapParagraphFromLine(IDocument document, int line, int[] caretOffset, boolean always) throws BadLocationException {
		String indent= jdocExtractLinePrefix(document, line);
		if (!always) {
			if (!indent.trim().startsWith("*")) 
				return;
			if (indent.trim().startsWith("*/")) 
				return;
			if (!isLineTooLong(document, line) && !isLineTooShort(document, line))
				return;
		}
		
		boolean caretRelativeToParagraphOffset= false;
		int caret= caretOffset[0];
		int caretLine= document.getLineOfOffset(caret);
		int lineOffset= document.getLineOffset(line);
		int paragraphOffset= lineOffset + indent.length();
		if (paragraphOffset < caret) {
			caret -= paragraphOffset;
			caretRelativeToParagraphOffset= true;
		} else {
			caret -= lineOffset;
		}
		StringBuffer buffer= new StringBuffer();
		int currentLine= line;