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
if (document.getLineOffset(lineIndex) >= partition.getOffset() + partition.getLength())
				return true;
			String string= document.get(line.getOffset(), line.getLength());				
			if (!string.trim().startsWith("*")) 
				return true;
			
			return false;
			
		} catch (BadLocationException e) {
			return false;
		}			
	}
	/*
	 * @see IAutoIndentStrategy#customizeDocumentCommand
	 */
	public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
		try {
			
			if (command.text != null && command.length == 0) {
				String[] lineDelimiters= document.getLegalLineDelimiters();
				int index= TextUtilities.endsWith(lineDelimiters, command.text);
				if (index > -1) {
					
					if (lineDelimiters[index].equals(command.text))
						
						jdocIndentAfterNewLine(document, command);
					return;
				}
			}