Bug 94261 [typing] Correct indent on paste broken?
20050509-2010 - select a method in the editor so that the selection contains the full lines (including indents before method) - press enter after the closing bracket (indent added) and paste - result is class A { void foo() { } void foo() { } }
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
int line= d.getLineOfOffset(p);
			int start= d.getLineOffset(line);
			int whiteend= findEndOfWhiteSpace(d, start, c.offset);
			JavaHeuristicScanner scanner= new JavaHeuristicScanner(d);
			JavaIndenter indenter= new JavaIndenter(d, scanner, fProject);
			
			if (whiteend == c.offset) {
				
				int reference= indenter.findReferencePosition(c.offset, false, true, false, false);
				int indLine= d.getLineOfOffset(reference);
				if (indLine != -1 && indLine != line) {
					
					StringBuffer replaceText= new StringBuffer(getIndentOfLine(d, indLine));
					
					replaceText.append(d.get(whiteend, c.offset - whiteend));
					replaceText.append(c.text);
					
					c.length += c.offset - start;
					c.offset= start;
					c.text= replaceText.toString();
				}
			}
		} catch (BadLocationException e) {
			JavaPlugin.log(e);
		}
	}
	private void smartIndentAfterOpeningBracket(IDocument d, DocumentCommand c) {
		if (c.offset < 1 || d.getLength() == 0)
			return;
		JavaHeuristicScanner scanner= new JavaHeuristicScanner(d);