copy.commitWorkingCopy(true, monitor);
copy.discardWorkingCopy();
}
IWorkbenchPartSite site = getEditorSite();
if (site != null) {
OrganizeImportsAction action = new OrganizeImportsAction(site);
action.run(unit);
}
type = getUnitMainType(unit);
rename(type, root);
if (unit.isWorkingCopy()) {
unit.commitWorkingCopy(true, monitor);