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
fStart= fEnd;
			fEnd= fIterator.next();
			if (fEnd == BreakIterator.DONE)
				return fEnd;
			final String string= fString.substring(fStart, fEnd);
			
			if (string.trim().length() == 0)
				return fEnd;
			final String word= string.trim();
			if (word.length() == string.length())
				return fEnd;
			
			
			fBufferedEnd= fEnd;
			return fStart + word.length();
		}	
	};
	
	/**
	 * Formats a paragraph, using break iterator.  
	 * 
	 * @param offset an offset within the paragraph, which will be updated with respect to formatting.
	 */
	private static String formatParagraph(String paragraph, int[] offset, String prefix, String lineDelimiter, int margin) {
		LineBreakIterator iterator= new LineBreakIterator(paragraph);
		StringBuffer paragraphBuffer= new StringBuffer();
		StringBuffer lineBuffer= new StringBuffer();
		StringBuffer whiteSpaceBuffer= new StringBuffer();
		
		int index= offset[0];