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
document.replace(command.offset, command.length, command.text);
		command.doit= false;
		if (command.text != null)
			command.offset += command.text.length();
		command.length= 0;
		command.text= null;			
	}
	protected void jdocWrapParagraphOnInsert(IDocument document, DocumentCommand command) throws BadLocationException {
		
		if (!getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_FORMAT_JAVADOCS))
			return;
		int line= document.getLineOfOffset(command.offset);
		IRegion region= document.getLineInformation(line);
		int lineOffset= region.getOffset();
		int lineLength= region.getLength();
		String lineContents= document.get(lineOffset, lineLength);						
		StringBuffer buffer= new StringBuffer(lineContents);
		int start= command.offset - lineOffset;
		int end= command.length + start; 
		buffer.replace(start, end, command.text);
		
				
		if (command.text != null && command.text.length() != 0 && command.text.trim().length() == 0) {
			String endOfLine= document.get(command.offset, lineOffset + lineLength - command.offset);
			
			if (endOfLine.length() == 0) {
				
				flushCommand(document, command);
				if (isLineTooShort(document, line)) { 
					int[] caretOffset= {command.offset};