return textEdit;
}
IActivityDataObject lastActivity = result.get(result.size() - 1);
if (lastActivity instanceof TextEditActivityDataObject) {
TextEditActivityDataObject lastTextEdit = (TextEditActivityDataObject) lastActivity;
if (((lastTextEdit.getSource() == null) || lastTextEdit.getSource()
.equals(textEdit.getSource()))
&& (textEdit.getOffset() == lastTextEdit.getOffset()
+ lastTextEdit.getText().length())) {
result.remove(lastTextEdit);
textEdit = new TextEditActivityDataObject(
lastTextEdit.getSource(),
lastTextEdit.getOffset(),
lastTextEdit.getText() + textEdit.getText(),
lastTextEdit.getReplacedText() + textEdit.getReplacedText(),
lastTextEdit.getPath());
}
}
return textEdit;
}