message += "jalopy";
}
message += ": ";
LOG.info(message + " under " + targetRootDirectory);
JavaImportBeautifierImpl beautifier = new JavaImportBeautifierImpl();
FormatManager manager = new FormatManager();
manager.setConvention(beautifier);
beautifier.setOrganizeImports(imports);
// There are problems with the Jalopy parser for the generated files:
// Unexpected char '<'
beautifier.setFormat(jalopy);
List<File> sourceFiles = manager.getAllJavaFiles(sourceRootDirectory);
// Now reformat and save the targeted files to the target directory
int listSize = sourceFiles.size();
for (int i = 0; i < listSize; i++) {
File sourceFile = (File) sourceFiles.get(i);
LOG.info(message + sourceFile.getName() + " under "
+ sourceFile.getParent());
CharacterSequence sequence = new CharacterSequence(
FileHelper.loadStringBuffer(sourceFile));
String original = sequence.getString();
try {
beautifier.beautify(sequence);
// Only overwrite the file if the beautifier changes it, or if a
// different directory
// Sometimes Jalopy throws an error and returns a zero length
// file.
if (sequence.length() > 1