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
Assert.isNotNull(pastedText);
			Assert.isTrue(pastedText.length() > 1);
			
			String strippedParagraph= stripIndent(pastedText, lineDelimiter);
			
			
			int offset= command.offset;
			int line= document.getLineOfOffset(offset);
			int lineOffset= document.getLineOffset(line);
			
			
			String prefix= document.get(lineOffset, offset - lineOffset);
			String blockIndent= getIndent(document, command);
			String indent= blockIndent == null ? "" : blockIndent + createIndent(1);  
			boolean formatFirstLine= prefix.trim().length() == 0;
			String formattedParagraph= format(strippedParagraph, indent, lineDelimiter, formatFirstLine);
			
			
			if (formatFirstLine) {
				int end= command.offset + command.length;
				command.offset= lineOffset;
				command.length= end - command.offset; 
			}
			command.text= formattedParagraph;
		} catch (BadLocationException e) {
			JavaPlugin.log(e);			
		}
	}	
	/**
	 * Returns the displayed width of a string, taking in account the displayed tab width.