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
&& (!original.equals(sequence.getString()))) {
File targetFile = new File((manager.getTargetDirectory(
sourceFile, sourceRootDirectory,
targetRootDirectory)), sourceFile.getName());
// File targetDirectory = new
// File((manager.getTargetDirectory(
// sourceFile, targetRootDirectory)), sourceFile.getName());
FileOutputStream outputSource = new FileOutputStream(
targetFile);
outputSource.write(sequence.getString().getBytes());
outputSource.flush();
outputSource.close();
}
} catch (RuntimeException e) {
LOG.error("Exception formatting file: " + sourceFile.getName(),