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
else
				indentFirstLine= true;
			buffer.append(line);
			if (iterator.hasNext())
				buffer.append(lineDelimiter);
		}
		
		return buffer.toString();	
	}
	
	private String getOneIndentLevel() {
		return String.valueOf('\t');
	}	
	
	/**
	 * Returns whether the text ends with one of the given search strings.
	 */
	private boolean endsWithDelimiter(IDocument d, String txt) {
		
		String[] delimiters= d.getLegalLineDelimiters();
		
		for (int i= 0; i < delimiters.length; i++) {
			if (txt.endsWith(delimiters[i]))
				return true;
		}
		
		return false;
	}
	private boolean equalsDelimiter(IDocument d, String txt) {