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
}
		
		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();		
				
		for (final Iterator iterator= new LineIterator(paragraph); iterator.hasNext();) {
			String line= (String) iterator.next();
			if (indentFirstLine && line.trim().length() != 0)	
				buffer.append(indent);