Bug 25870 Code assist for comments doesn't add new line character.
Eclipse's code assist for comment and javadoc doesn't add a line feed character to the second line of comment, it adds only carriage return character. Since other editors do not treat carriage return itself as a line feed, line nubmers for the source will appear differently between eclipse and other editors. HOW TO REPRODUCE: 1. In java file, type /** then press enter. eclipse will add the following to the source. /** * comment */ 2. Open this file with a different editor: vi, emacs, etc. You will see your comment looking like this instead... /** * comment */ 3. line number for your source after this comment will appear differently between eclipse editor and any other editor.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocAutoIndentStrategy.java
ITypedRegion partition= document.getPartition(commandOffset);
			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 {
			ITypedRegion partition= document.getPartition(command.offset);			
			int partitionStart= partition.getOffset();
			int partitionEnd= partition.getLength() + partitionStart;			
			
			String text= command.text;
			int offset= command.offset;
			int length= command.length;
			
			final int PREFIX_LENGTH= "/**".length(); 
			final int POSTFIX_LENGTH= "*/".length(); 
			if ((offset < partitionStart + PREFIX_LENGTH || offset + length > partitionEnd - POSTFIX_LENGTH) ||
				text != null && text.length() >= 2 && ((text.indexOf("*/") != -1) || (document.getChar(offset) == '*' && text.startsWith("/"))))