fixed bug in CPD directory scanning

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@660 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2002-08-08 19:49:13 +00:00
parent 98ad2717f7
commit 3386186533
2 changed files with 5 additions and 2 deletions

View File

@ -73,8 +73,10 @@ public class CPD {
String[] possibles = dir.list(filter);
for (int i=0; i<possibles.length; i++) {
File tmp = new File(dir + System.getProperty("file.separator") + possibles[i]);
if (recurse && tmp.isDirectory()) {
scanDirectory(tmp, list, true);
if (tmp.isDirectory()) {
if (recurse) {
scanDirectory(tmp, list, true);
}
} else {
list.add(new File(dir + System.getProperty("file.separator") + possibles[i]));
}

View File

@ -156,6 +156,7 @@ public class GUI implements CPDListener {
resultsTextArea.append(renderer.render(cpd));
} catch (IOException ioe) {
ioe.printStackTrace();
JOptionPane.showMessageDialog(null, "Halted due to " + ioe.getClass().getName() + "; " + ioe.getMessage());
}
}