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 index= line.indexOf(trimmedLine);
			String indent= line.substring(0, index);
			int width= calculateDisplayedWidth(indent);
			minIndentWidth= Math.min(minIndentWidth, width);
		}
		
		for (final Iterator iterator= new LineIterator(paragraph); iterator.hasNext();) {
			String line= (String) iterator.next();
			String trimmedLine= line.trim();			
			if (trimmedLine.length() != 0) {
				int index= line.indexOf(trimmedLine);
				String indent= line.substring(0, index);
				int width= calculateDisplayedWidth(indent);
				int strippedWidth= width - minIndentWidth;
				String prefix= createPrefix(strippedWidth);
	
				buffer.append(prefix);
				buffer.append(trimmedLine);
			}
			if (iterator.hasNext())
				buffer.append(lineDelimiter);
		}
		
		return buffer.toString();		
	}
	
	private String format(String paragraph, String indent, String lineDelimiter, boolean indentFirstLine) {
		
		final StringBuffer buffer= new StringBuffer();