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 p= (c.offset == d.getLength() ? c.offset  - 1 : c.offset);
			IRegion info= d.getLineInformationOfOffset(p);
			int start= info.getOffset();
			
			
			int end= findEndOfWhiteSpace(d, start, c.offset);
			
			StringBuffer buf= new StringBuffer(c.text);
			if (end >= start) {	
				
				String indentation= jdocExtractLinePrefix(d, d.getLineOfOffset(c.offset));
				buf.append(indentation);
				if (end < c.offset) {
					if (d.getChar(end) == '/') {
						
						buf.append(" * "); 
						if (JavaPlugin.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_CLOSE_JAVADOCS) &&
							isNewComment(d, c.offset))
						{
							String lineDelimiter= getLineDelimiter(d);
							c.doit= false;
							d.replace(c.offset, 0, lineDelimiter + indentation + " */"); 
							
							
							ICompilationUnit unit= getCompilationUnit();
							if (JavaPlugin.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_ADD_JAVADOC_TAGS) &&
								unit != null)
							{
								try {