Bug 50194 Indenting Java breaks comments
When correcting indentation (ctrl-I in my configuration), java comments are not properly preserved. My original code [1] is 'indented' to code [2], which is unexpected and syntactically incorrect. thanks PhF .. [1] try{ /* for(int i=0; i<8; i++){ System.out.println("something");} */ somethingElse(); .. [2] try{ /* */ for(int i=0; i<8; i++){ System.out.println("something");} */ somethingElse();
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocAutoIndentStrategy.java
document.replace(command.offset, command.length, command.text);
		command.doit= false;
		if (command.text != null)
			command.offset += command.text.length();
		command.length= 0;
		command.text= null;			
	}
	protected void jdocWrapParagraphOnInsert(IDocument document, DocumentCommand command) throws BadLocationException {
		
		if (!getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_FORMAT_JAVADOCS))
			return;
		int line= document.getLineOfOffset(command.offset);
		IRegion region= document.getLineInformation(line);
		int lineOffset= region.getOffset();
		int lineLength= region.getLength();
		String lineContents= document.get(lineOffset, lineLength);						
		StringBuffer buffer= new StringBuffer(lineContents);
		int start= command.offset - lineOffset;
		int end= command.length + start; 
		buffer.replace(start, end, command.text);
		
				
		if (command.text != null && command.text.length() != 0 && command.text.trim().length() == 0) {
			String endOfLine= document.get(command.offset, lineOffset + lineLength - command.offset);
			
			if (endOfLine.length() == 0) {
				
				flushCommand(document, command);
				if (isLineTooShort(document, line)) { 
					int[] caretOffset= {command.offset};