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
ITypedRegion region= partitioner.getPartition(start);
					if (JavaPartitionScanner.JAVA_DOC.equals(region.getType()))
						start= d.getLineInformationOfOffset(region.getOffset()).getOffset();
				}				
				int whiteend= findEndOfWhiteSpace(d, start, c.offset);
				buf.append(d.get(start, whiteend - start));
				if (getBracketCount(d, start, c.offset, true) > 0) {
					buf.append(getOneIndentLevel());
				}
			}
			c.text= buf.toString();
		} catch (BadLocationException excp) {
			System.out.println(JavaTextMessages.getString("AutoIndent.error.bad_location.message2")); 
		}
	}
	private static String getLineDelimiter(IDocument document) {
		try {
			if (document.getNumberOfLines() > 1)
				return document.getLineDelimiter(0);
		} catch (BadLocationException e) {
			JavaPlugin.log(e);
		}	
		return System.getProperty("line.separator"); 
	}
	
	protected void smartPaste(IDocument document, DocumentCommand command) {
		String lineDelimiter= getLineDelimiter(document);
		
		try {
			String pastedText= command.text;