Bug 26599 BadLocationException in JavaAutoIndentStrategy
I20021115: - Open the Java editor - select/copy a couple of lines with soem indentation - select all lines and delete them - paste them into the empty editor -> JavaAutoIndentStrategy.calcShiftBackReplace: BadLocationException
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
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 (useSpaces()) {
			int tabWidth= getPreferenceStore().getInt(PreferenceConstants.EDITOR_TAB_WIDTH);
			int width= level * tabWidth;
			for (int i= 0; i != width; ++i)	
				buffer.append(' ');
		} else {
			buffer.append('\t');
		}
		
		return buffer.toString();			
	}