Bug 26377 Editor copy/paste not working when replacing code
Build 20021114 Attempting to replace some text with clipboard content, it ends up overriding the prefix of the target text only (target is larger than clipboard): select 'argSlotSize' and paste it over selected word argSlotSizeze . It will leave some of the selected word in. testcase: package p; public class Y { static void y(){ int argSlotSize = 1; argSlotSizeze += 2; } }
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
int column= 0;
		for (int i= 0; i < string.length(); i++)
			if ('\t' == string.charAt(i))
				column += tabWidth - (column % tabWidth);
			else
				column++;
				
		return column;
	}
	
	private String getIndent(IDocument d, DocumentCommand c) {
		if (c.offset < 0)
			return null;
		
		try {
			int p= (c.offset == d.getLength() ? c.offset - 1 : c.offset);
			int line= d.getLineOfOffset(p);
			
			int indLine= findMatchingOpenBracket(d, line, c.offset, 1);
			if (indLine != -1 && indLine != line)
				
				return getIndentOfLine(d, indLine);
		} catch (BadLocationException excp) {
			System.out.println(JavaTextMessages.getString("AutoIndent.error.bad_location.message1")); 
		}
		return null;
	}
	
	private static final class LineIterator implements Iterator {