forked from phoedos/pmd
Merge branch 'master' of https://github.com/msloan/pmd into msloan-master
This commit is contained in:
@ -10,6 +10,7 @@ import java.io.FilenameFilter;
|
|||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
import java.nio.file.Path;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -277,7 +278,7 @@ public class CPDConfiguration extends AbstractConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final FilenameFilter languageFilter = language.getFileFilter();
|
final FilenameFilter languageFilter = language.getFileFilter();
|
||||||
final Set<String> exclusions = new HashSet<String>();
|
final Set<Path> exclusions = new HashSet<Path>();
|
||||||
|
|
||||||
if (excludes != null) {
|
if (excludes != null) {
|
||||||
FileFinder finder = new FileFinder();
|
FileFinder finder = new FileFinder();
|
||||||
@ -285,10 +286,10 @@ public class CPDConfiguration extends AbstractConfiguration {
|
|||||||
if (excludedFile.isDirectory()) {
|
if (excludedFile.isDirectory()) {
|
||||||
List<File> files = finder.findFilesFrom(excludedFile, languageFilter, true);
|
List<File> files = finder.findFilesFrom(excludedFile, languageFilter, true);
|
||||||
for (File f : files) {
|
for (File f : files) {
|
||||||
exclusions.add(f.getAbsolutePath());
|
exclusions.add(f.toPath());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
exclusions.add(excludedFile.getAbsolutePath());
|
exclusions.add(excludedFile.toPath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -296,7 +297,7 @@ public class CPDConfiguration extends AbstractConfiguration {
|
|||||||
FilenameFilter filter = new FilenameFilter() {
|
FilenameFilter filter = new FilenameFilter() {
|
||||||
public boolean accept(File dir, String name) {
|
public boolean accept(File dir, String name) {
|
||||||
File f = new File(dir, name);
|
File f = new File(dir, name);
|
||||||
if (exclusions.contains(f.getAbsolutePath())) {
|
if (exclusions.contains(f.toPath())) {
|
||||||
System.err.println("Excluding " + f.getAbsolutePath());
|
System.err.println("Excluding " + f.getAbsolutePath());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user