aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api-impl
diff options
context:
space:
mode:
authorDimitris Kavvathas <dimitris.kavvathas@sonarsource.com>2022-12-07 11:10:47 +0100
committersonartech <sonartech@sonarsource.com>2022-12-12 20:04:02 +0000
commit978818983042dcad1e997cc81c8a98c9724bfb80 (patch)
treec79e3792119850141e6c0f9c4326adbedab39410 /sonar-plugin-api-impl
parent133d15e977d3d2a71413578ac5b8c72d918b8b7d (diff)
downloadsonarqube-978818983042dcad1e997cc81c8a98c9724bfb80.tar.gz
sonarqube-978818983042dcad1e997cc81c8a98c9724bfb80.zip
SONAR-17518 Ignore AccessDeniedException of directory, if it is excluded.
Diffstat (limited to 'sonar-plugin-api-impl')
-rw-r--r--sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/fs/internal/PathPattern.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/fs/internal/PathPattern.java b/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/fs/internal/PathPattern.java
index fb5f77f3967..eff388bb44a 100644
--- a/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/fs/internal/PathPattern.java
+++ b/sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/fs/internal/PathPattern.java
@@ -20,6 +20,7 @@
package org.sonar.api.batch.fs.internal;
import java.nio.file.Path;
+import java.util.Arrays;
import javax.annotation.concurrent.ThreadSafe;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang.StringUtils;
@@ -58,11 +59,7 @@ public abstract class PathPattern {
}
public static PathPattern[] create(String[] s) {
- PathPattern[] result = new PathPattern[s.length];
- for (int i = 0; i < s.length; i++) {
- result[i] = create(s[i]);
- }
- return result;
+ return Arrays.stream(s).map(PathPattern::create).toArray(PathPattern[]::new);
}
/**