private void listDirectory(File directory, Set<JavaFileObject.Kind> fileKinds, ListBuffer<JavaFileObject> resultList) {
final File[] files = directory.listFiles();
if (files != null) {
if (sortFiles != null) {
Arrays.sort(files, sortFiles);
<BUG>}
for (File f: files) {
String fileName = f.getName();

if (isValidFile(fileName, fileKinds) && isFile(f)) {
JavaFileObject fe = new InputFileObject(this, f);
</BUG>
resultList.append(fe);

private void listDirectory(File directory, Set<JavaFileObject.Kind> fileKinds, ListBuffer<JavaFileObject> resultList) {
final File[] files = directory.listFiles();
if (files != null) {
if (sortFiles != null) {
Arrays.sort(files, sortFiles);
