ISourceRange range= getNodeRange(node); endPos= range.getOffset() + range.getLength();
endPos= getExtendedEnd(node);
	private int rewriteBodyNode(ASTNode parent, int property, int offset, int endPos, int indent, BlockContext context) {		RewriteEvent event= getEvent(parent, property);		if (event != null) {			switch (event.getChangeKind()) {				case RewriteEvent.INSERTED: {					ASTNode node= (ASTNode) event.getNewValue();					GroupDescription description= getDescription(event);										String[] strings= context.getPrefixAndSuffix(indent, getLineDelimiter(), node);										doTextInsert(offset, strings[0], description);					doTextInsert(offset, node, indent, true, description);					doTextInsert(offset, strings[1], description);					return offset;				}				case RewriteEvent.REMOVED: {					ASTNode node= (ASTNode) event.getOriginalValue();					if (endPos == -1) {						ISourceRange range= getNodeRange(node);						endPos= range.getOffset() + range.getLength();					}										GroupDescription description= getDescription(event);					// if there is a prefix, remove the prefix as well					int len= endPos - offset;					doTextRemoveAndVisit(offset, len, node, description);					return endPos;				}				case RewriteEvent.REPLACED: {					ASTNode node= (ASTNode) event.getOriginalValue();					if (endPos == -1) {						ISourceRange range= getNodeRange(node);						endPos= range.getOffset() + range.getLength();					}					GroupDescription description= getDescription(event);					int nodeLen= endPos - offset; 										ASTNode replacingNode= (ASTNode) event.getNewValue();					String[] strings= context.getPrefixAndSuffix(indent, getLineDelimiter(), replacingNode);					doTextRemoveAndVisit(offset, nodeLen, node, description);										String prefix= strings[0];					doTextInsert(offset, prefix, description);					String lineInPrefix= getCurrentLine(prefix, prefix.length());					if (prefix.length() != lineInPrefix.length()) {						// prefix contains a new line: update the indent to the one used in the prefix						indent= Strings.computeIndent(lineInPrefix, CodeFormatterUtil.getTabWidth());					}					doTextInsert(offset, replacingNode, indent, true, description);					doTextInsert(offset, strings[1], description);					return endPos;				}			}		}		return doVisit(parent, property, offset);	}