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
return buffer.toString();			
	}
	
	private static String createPrefix(int displayedWidth) {
		StringBuffer buffer= new StringBuffer();
		if (CodeFormatterPreferencePage.useSpaces()) {
			for (int i= 0; i != displayedWidth; ++i)	
				buffer.append(' ');
		} else {
			int tabWidth= getPreferenceStore().getInt(JavaSourceViewerConfiguration.PREFERENCE_TAB_WIDTH);
			int div= displayedWidth / tabWidth;
			int mod= displayedWidth % tabWidth;
			for (int i= 0; i != div; ++i)
				buffer.append('\t');	
			for (int i= 0; i != mod; ++i)	
				buffer.append(' ');				 
		} 
		return buffer.toString();
	}
	
	private String stripIndent(String paragraph, String lineDelimiter) {
		final StringBuffer buffer= new StringBuffer();		
		
		int minIndentWidth= Integer.MAX_VALUE;				
		for (final Iterator iterator= new LineIterator(paragraph); iterator.hasNext();) {
			String line= (String) iterator.next();
			String trimmedLine= line.trim();			
			if (trimmedLine.length() == 0)
				continue;