From 978818983042dcad1e997cc81c8a98c9724bfb80 Mon Sep 17 00:00:00 2001 From: Dimitris Kavvathas Date: Wed, 7 Dec 2022 11:10:47 +0100 Subject: SONAR-17518 Ignore AccessDeniedException of directory, if it is excluded. --- .../src/main/java/org/sonar/api/batch/fs/internal/PathPattern.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sonar-plugin-api-impl') 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); } /** -- cgit v1.2.3