}
protected TextChange createTextChange() throws CoreException {
ICompilationUnit cu = m_cu;
String name = "TestNG";
TextChange change = null;
// if (!cu.getResource().exists()) {
// String source;
// try {
// source= cu.getSource();
// } catch (JavaModelException e) {
// JavaPlugin.log(e);
// source= new String(); // empty
// }
// }
Document document= new Document(cu.getSource());
document.setInitialLineDelimiter(StubUtility.getLineDelimiterUsed(cu));
change= new DocumentChange(name, document);
// } else {
// Document doc = new Document(m_cu.getSource());
// CompilationUnitChange cuChange = new CompilationUnitChange(name, cu);
// cuChange.setSaveMode(TextFileChange.LEAVE_DIRTY);
// change= cuChange;
// }
TextEdit rootEdit= new MultiTextEdit();
change.setEdit(rootEdit);
// initialize text change
// IDocument document= change.getCurrentDocument(new NullProgressMonitor());
addEdits(change.getCurrentDocument(new NullProgressMonitor()), rootEdit);
return change;
}