Strangely, after the call to targetUnit.applyTextEdit, targetUnit.getSource() will show the changed source, but this change is not applied to the file. I verified, that targetUnit is not a workingCopy. Is this a bug or am I missing something?