aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api-impl
diff options
context:
space:
mode:
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);
}
/**