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/IndentUtil.java
while (from < endOffset - 2 && document.get(from, 2).equals(SLASHES))
			from += 2;
		int to= from;
		while (toDelete > 0 && to < endOffset) {
			char ch= document.getChar(to);
			if (!Character.isWhitespace(ch))
				break;
			toDelete -= computeVisualLength(ch, tabSize);
			if (toDelete >= 0)
				to++;
			else
				break;
		}
		
		if (endOffset > to + 1 && document.get(to, 2).equals(SLASHES))
			commentLines[relative]= true;
		document.replace(from, to - from, null);
	}
	/**
	 * Computes the difference of two indentations and returns the difference in
	 * length of current and correct. If the return value is positive, <code>addition</code>
	 * is initialized with a substring of that length of <code>correct</code>.
	 *
	 * @param correct the correct indentation
	 * @param current the current indentation (migth contain non-whitespace)
	 * @param difference a string buffer - if the return value is positive, it will be cleared and set to the substring of <code>current</code> of that length
	 * @return the difference in lenght of <code>correct</code> and <code>current</code>
	 */
	private static int subtractIndent(CharSequence correct, CharSequence current, StringBuffer difference, int tabSize) {
		int c1= computeVisualLength(correct, tabSize);