예제 #1
0
 public static List<DataSource> getApplicableFiles(
     PMDConfiguration configuration, Set<Language> languages) {
   long startFiles = System.nanoTime();
   LanguageFilenameFilter fileSelector = new LanguageFilenameFilter(languages);
   List<DataSource> files = FileUtil.collectFiles(configuration.getInputPaths(), fileSelector);
   long endFiles = System.nanoTime();
   Benchmarker.mark(Benchmark.CollectFiles, endFiles - startFiles, 0);
   return files;
 }
예제 #2
0
 private static void sortFiles(
     final PMDConfiguration configuration, final List<DataSource> files) {
   if (configuration.isStressTest()) {
     // randomize processing order
     Collections.shuffle(files);
   } else {
     final boolean useShortNames = configuration.isReportShortNames();
     final String inputPaths = configuration.getInputPaths();
     Collections.sort(
         files,
         new Comparator<DataSource>() {
           public int compare(DataSource left, DataSource right) {
             String leftString = left.getNiceFileName(useShortNames, inputPaths);
             String rightString = right.getNiceFileName(useShortNames, inputPaths);
             return leftString.compareTo(rightString);
           }
         });
   }
 }