diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2018-11-26 16:36:06 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2019-01-16 09:43:03 +0100 |
commit | cc9d2163a0feb24e4139db55bb616368122a18d4 (patch) | |
tree | e21b1f7a959ff65e8f67f7a731638d4a2bbbdd31 /sonar-plugin-api | |
parent | 38abb93944c9e0887bed470595882ef1822e4b2c (diff) | |
download | sonarqube-cc9d2163a0feb24e4139db55bb616368122a18d4.tar.gz sonarqube-cc9d2163a0feb24e4139db55bb616368122a18d4.zip |
SONAR-11508, SONAR-11484 Index files at project level
Diffstat (limited to 'sonar-plugin-api')
3 files changed, 9 insertions, 11 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/InputFileFilter.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/InputFileFilter.java index 49d6ceee2dc..4535e465247 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/InputFileFilter.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/InputFileFilter.java @@ -20,12 +20,13 @@ package org.sonar.api.batch.fs; import org.sonar.api.ExtensionPoint; -import org.sonar.api.batch.ScannerSide; +import org.sonar.api.scanner.ScannerSide; import org.sonarsource.api.sonarlint.SonarLintSide; /** * Extension point to exclude some files from inspection * @since 4.2 + * @since 7.6 evaluated at project level */ @ScannerSide @SonarLintSide diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/FileMetadata.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/FileMetadata.java index 3b52498ceaf..bda14d89d4b 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/FileMetadata.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/FileMetadata.java @@ -26,11 +26,8 @@ import java.io.InputStreamReader; import java.io.Reader; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; - import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; - -import org.sonar.api.batch.ScannerSide; import org.sonar.api.batch.fs.InputFile; import org.sonar.api.batch.fs.internal.charhandler.CharHandler; import org.sonar.api.batch.fs.internal.charhandler.FileHashComputer; @@ -42,7 +39,6 @@ import org.sonar.api.batch.fs.internal.charhandler.LineOffsetCounter; * Computes hash of files. Ends of Lines are ignored, so files with * same content but different EOL encoding have the same hash. */ -@ScannerSide @Immutable public class FileMetadata { private static final char LINE_FEED = '\n'; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileExclusions.java b/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileExclusions.java index e98b77161d4..35753e14fce 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileExclusions.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileExclusions.java @@ -37,10 +37,11 @@ import org.sonar.api.config.Configuration; @Deprecated @ScannerSide public class FileExclusions { - private final Configuration settings; - public FileExclusions(Configuration settings) { - this.settings = settings; + private final Configuration config; + + public FileExclusions(Configuration config) { + this.config = config; } public String[] sourceInclusions() { @@ -52,7 +53,7 @@ public class FileExclusions { } private String[] inclusions(String propertyKey) { - return Arrays.stream(settings.getStringArray(propertyKey)) + return Arrays.stream(config.getStringArray(propertyKey)) .map(StringUtils::trim) .filter(s -> !"**/*".equals(s)) .filter(s -> !"file:**/*".equals(s)) @@ -68,8 +69,8 @@ public class FileExclusions { } private String[] exclusions(String globalExclusionsProperty, String exclusionsProperty) { - String[] globalExclusions = settings.getStringArray(globalExclusionsProperty); - String[] exclusions = settings.getStringArray(exclusionsProperty); + String[] globalExclusions = config.getStringArray(globalExclusionsProperty); + String[] exclusions = config.getStringArray(exclusionsProperty); return Stream.concat(Arrays.stream(globalExclusions), Arrays.stream(exclusions)) .map(StringUtils::trim) .toArray(String[]::new); |