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
return calculateDisplayedWidth(lineContents) > getMargin();
	}
	private static int getMargin() {
		return getPreferenceStore().getInt(PreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN);
	}
	private static final String[] fgInlineTags= {
		"<b>", "<i>", "<em>", "<strong>", "<code>"  
	};
	
	private boolean isInlineTag(String string) {
		for (int i= 0; i < fgInlineTags.length; i++)
			if (string.startsWith(fgInlineTags[i]))
				return true;	
		return false;
	}
	
	/**
	 * returns true if the specified line is part of a paragraph and should be merged with
	 * the previous line.
	 */
	private boolean isJavaDocLine(IDocument document, int line) throws BadLocationException {
		if (document.getNumberOfLines() < line)
			return false;
		int offset= document.getLineOffset(line);
		int length= document.getLineLength(line);
		int firstChar= findEndOfWhiteSpace(document, offset, offset + length);
		length -= firstChar - offset;
		String lineContents= document.get(firstChar, length);
		String prefix= lineContents.trim();		
		if (!prefix.startsWith("*") || prefix.startsWith("*/"))