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
public JavaAutoIndentStrategy() {
	}
	
	protected int findMatchingOpenBracket(IDocument d, int line, int end, int closingBracketIncrease) throws BadLocationException {
		int start= d.getLineOffset(line);
		int brackcount= getBracketCount(d, start, end, false) - closingBracketIncrease;
		 
		
		while (brackcount < 0) {
			line--;
			if (line < 0) {
				return -1;
			}
			start= d.getLineOffset(line);
			end= start + d.getLineLength(line) - 1;
			brackcount += getBracketCount(d, start, end, false);
		}
		return line;
	}
	private int getBracketCount(IDocument d, int start, int end, boolean ignoreCloseBrackets) throws BadLocationException {
		int bracketcount= 0;
		while (start < end) {
			char curr= d.getChar(start);
			start++;
			switch (curr) {
				case '/' :
					if (start < end) {
						char next= d.getChar(start);
						if (next == '*') {