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
offset[0] -= (index - (start - whiteSpaceBuffer.length()));
						indexBuffer= -1;
					}
					whiteSpaceBuffer.setLength(0);
				
				} else {
					lineBuffer.append(whiteSpaceBuffer.toString());
					lineBuffer.append(word);
					whiteSpaceBuffer.setLength(0);
				}
			}
			if (index >= start && index < end) {
				indexBuffer= paragraphBuffer.length() + lineBuffer.length() + (index - start);
				if (word.trim().length() != 0)
					indexBuffer -= word.length();
			}
		}
				
		paragraphBuffer.append(lineBuffer.toString());
		paragraphBuffer.append(lineDelimiter);
		
		if (indexBuffer != -1)	
			offset[0]= indexBuffer;
		
		else if (offset[0] == paragraph.length())
			offset[0]= paragraphBuffer.length() - lineDelimiter.length();
			
		return paragraphBuffer.toString();
	}
	private static IPreferenceStore getPreferenceStore() {