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 p= (c.offset == d.getLength() ? c.offset - 1 : c.offset);
		try {
			
			int line= d.getLineOfOffset(p);
			int lineOffset= d.getLineOffset(line);
			
			if (d.get(lineOffset, p - lineOffset).trim().length() != 0)
				return;
			
			int pos= scanner.findNonWhitespaceBackward(p, JavaHeuristicScanner.UNBOUND);
			if (pos == -1)
				return;
			int lastLine= d.getLineOfOffset(pos);
			
			if (lastLine < line) {
				JavaIndenter indenter= new JavaIndenter(d, scanner, fProject);
				StringBuffer indent= indenter.computeIndentation(p, true);
				String toDelete= d.get(lineOffset, c.offset - lineOffset);
				if (indent != null && !indent.toString().equals(toDelete)) {
					c.text= indent.append(c.text).toString();
					c.length += c.offset - lineOffset;
					c.offset= lineOffset;
				}
			}
		} catch (BadLocationException e) {
			JavaPlugin.log(e);
		}
	}
	private void smartIndentAfterNewLine(IDocument d, DocumentCommand c) {
		JavaHeuristicScanner scanner= new JavaHeuristicScanner(d);