ISourceRange range = field.getSourceRange();
IBuffer buf = cu.getBuffer();
String originalContent = buf.getText(range.getOffset(), range.getLength());
String formattedContent = CodeFormatterUtil.format(CodeFormatter.K_CLASS_BODY_DECLARATIONS, originalContent, 1, null,
lineDelimiter, field.getJavaProject());
buf.replace(range.getOffset(), range.getLength(), formattedContent);
if (!cu.isWorkingCopy())
buf.save(null, false);
imports.create(needsSave, new SubProgressMonitor(monitor, 1));
removeUnusedImports(cu, needsSave);