ICompilationUnit unit = root.getCompilationUnit();
ICompilationUnit copy = unit.getWorkingCopy(monitor);
IType type = getUnitMainType(copy);
if (type != null) {
ImportRewrite imports = createImportRewrite(copy);
boolean success = parser.generateCode(type, imports, monitor);
if (!success)
return null;
removeRemovedComponent(root, monitor, unit, type);
createPreferredLnf(root, monitor, type, imports);
if (success) {