1
1
/*
2
- * Copyright 2005-2023 the original author or authors.
2
+ * Copyright 2005-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@ package org.codehaus.mojo.spotbugs
17
17
18
18
import groovy.xml.XmlParser
19
19
import groovy.xml.XmlSlurper
20
+ import org.apache.commons.io.FileUtils
20
21
21
22
import org.apache.maven.artifact.repository.ArtifactRepository
22
23
@@ -40,7 +41,6 @@ import org.apache.maven.project.MavenProject
40
41
import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver
41
42
42
43
import org.codehaus.plexus.resource.ResourceManager
43
- import org.codehaus.plexus.util.FileUtils
44
44
45
45
abstract class BaseViolationCheckMojo extends AbstractMojo {
46
46
@@ -503,16 +503,19 @@ abstract class BaseViolationCheckMojo extends AbstractMojo {
503
503
}
504
504
505
505
private boolean doSourceFilesExist () {
506
- List sourceFiles = new ArrayList ()
506
+ Collection< File > sourceFiles = new ArrayList<> ()
507
507
508
508
if (this . classFilesDirectory. isDirectory()) {
509
- sourceFiles. addAll(FileUtils . getFiles(classFilesDirectory, SpotBugsInfo . JAVA_REGEX_PATTERN , null ))
509
+ log. debug(" looking for class files with extensions: " + SpotBugsInfo . EXTENSIONS )
510
+ sourceFiles. addAll(FileUtils . listFiles(classFilesDirectory, SpotBugsInfo . EXTENSIONS , true ))
510
511
}
511
512
512
513
if (this . includeTests && this . testClassFilesDirectory. isDirectory()) {
513
- sourceFiles. addAll(FileUtils . getFiles(testClassFilesDirectory, SpotBugsInfo . JAVA_REGEX_PATTERN , null ))
514
+ log. debug(" looking for test class files: " + SpotBugsInfo . EXTENSIONS )
515
+ sourceFiles. addAll(FileUtils . listFiles(testClassFilesDirectory, SpotBugsInfo . EXTENSIONS , true ))
514
516
}
515
517
518
+ log. debug(" SourceFiles: " + Arrays . toString(sourceFiles));
516
519
! sourceFiles. isEmpty()
517
520
}
518
521
0 commit comments