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
try {			
				IRegion region= fDocument.getLineInformation(fLineIndex++);
				return fDocument.get(region.getOffset(), region.getLength());
			} catch (BadLocationException e) {
				JavaPlugin.log(e);
				throw new NoSuchElementException();	
			}
		}
		/*
		 * @see java.util.Iterator#remove()
		 */
		public void remove() {
			throw new UnsupportedOperationException();
		}
	}
	
	private static IPreferenceStore getPreferenceStore() {
		return JavaPlugin.getDefault().getPreferenceStore();		
	}
	
	private static String createIndent(int level) {
		StringBuffer buffer= new StringBuffer();
		if (CodeFormatterPreferencePage.useSpaces()) {
			int tabWidth= getPreferenceStore().getInt(JavaSourceViewerConfiguration.PREFERENCE_TAB_WIDTH);
			int width= level * tabWidth;
			for (int i= 0; i != width; ++i)	
				buffer.append(' ');
		} else {
			buffer.append('\t');
		}