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
}		
	}
	
	private static IRegion createRegion(ASTNode node, int delta) {
		return node == null ? null : new Region(node.getStartPosition() + delta, node.getLength());
	}
	
	private static IRegion getToken(IDocument document, IRegion scanRegion, int tokenId)  {
		try {
			
			final String source= document.get(scanRegion.getOffset(), scanRegion.getLength());
	
			IScanner scanner= ToolFactory.createScanner(false, false, false, false);
			scanner.setSource(source.toCharArray());
			int id= scanner.getNextToken();
			while (id != ITerminalSymbols.TokenNameEOF && id != tokenId)
				id= scanner.getNextToken();
			if (id == ITerminalSymbols.TokenNameEOF)
				return null;
			int tokenOffset= scanner.getCurrentTokenStartPosition();
			int tokenLength= scanner.getCurrentTokenEndPosition() + 1 - tokenOffset; 
			return new Region(tokenOffset + scanRegion.getOffset(), tokenLength);
		} catch (InvalidInputException x) {
			return null;
		} catch (BadLocationException x) {
			return null;
		}
	}
}