Bug 50230 Paste omits a character
20040119 - In the following text, double click on 'rel' to get the word selected. - CTRL + C - Set cursor between empty brackets, paste -> only pastes 'el', the letter 'r' is gone protected Object getAttribute(Object parent, int childProperty) { if (child instanceof List) { } else if (rel != null && !rel.equals(child)) { } else if () return child; }
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
contents.append(source);
			contents.append('}');
			
			char[] buffer= contents.toString().toCharArray();
	
			return new CompilationUnitInfo(buffer, sourceRange.getOffset() - methodOffset);
	
		} catch (BadLocationException e) {
			JavaPlugin.log(e);
		}
	
		return null;
	}
	
	private static boolean areBlocksConsistent(IDocument document, int offset, String partitioning) {
		if (offset < 1 || offset >= document.getLength())
			return false;
		
		int begin= offset;
		int end= offset - 1;
		
		JavaHeuristicScanner scanner= new JavaHeuristicScanner(document);
		
		while (true) {
			begin= scanner.findOpeningPeer(begin - 1, '{', '}');
			end= scanner.findClosingPeer(end + 1, '{', '}');
			if (begin == -1 && end == -1)
				return true;
			if (begin == -1 || end == -1)
				return false;