Bug 99725 [typing] Moving first line of header comment increases indentation
Given a class like this: /** * Header comment */ class Foo { } Put the cursor on the first line, and use Alt+Down, Alt+Up to move it down, and then up. An extra space is added in front. If you now select the entire file and use Source > Indent, the whole file is shifted one character to the right.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaMoveLinesAction.java
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
import org.eclipse.ui.texteditor.TextEditorAction;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.javaeditor.IndentUtil.IndentResult;
/**
 * Action for moving selected lines in a Java editor.
 * @since 3.1
 */
public class JavaMoveLinesAction extends TextEditorAction {
	/**
	 * State shared by the Move / Copy lines action quadruple.
	 * @since 3.1
	 */
	private static final class SharedState {
		
		public CompilationUnitEditor fEditor;
		/**
		 * The indent token shared by all four actions.
		 */
		public IndentResult fResult= null;
		/**
		 * Set to true before modifying the document, to false after.
		 */
		boolean fIsChanging= false;
		
		
		private boolean fEditInProgress= false;