aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src/main
diff options
context:
space:
mode:
authorMatteo Mara <matteo.mara@sonarsource.com>2023-12-20 12:34:14 +0100
committersonartech <sonartech@sonarsource.com>2023-12-21 20:02:33 +0000
commitb6bbc6d5000b3d9bc81e2f8082b451985a7e9145 (patch)
tree2296044ebaa803ad7cd30f49a679621cc9510c7d /sonar-scanner-engine/src/main
parentb2bf62fd3a2507e05539befb66c6292757b535a4 (diff)
downloadsonarqube-b6bbc6d5000b3d9bc81e2f8082b451985a7e9145.tar.gz
sonarqube-b6bbc6d5000b3d9bc81e2f8082b451985a7e9145.zip
SONAR-21195 Address pull request feedback
Diffstat (limited to 'sonar-scanner-engine/src/main')
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/LanguageDetection.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/LanguageDetection.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/LanguageDetection.java
index 24128133824..5a52107a8bf 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/LanguageDetection.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/LanguageDetection.java
@@ -22,6 +22,7 @@ package org.sonar.scanner.scan.filesystem;
import java.nio.file.Path;
import java.text.MessageFormat;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -56,7 +57,7 @@ public class LanguageDetection {
private final List<Language> languagesToConsider;
private final Map<String, Language> languageCacheByPath;
- public LanguageDetection(Configuration settings, LanguagesRepository languages, Map<String, Language> languageCache) {
+ public LanguageDetection(Configuration settings, LanguagesRepository languages) {
Map<Language, PathPattern[]> patternsByLanguageBuilder = new LinkedHashMap<>();
for (Language language : languages.all()) {
String[] filePatterns = settings.getStringArray(getFileLangPatternPropKey(language.key()));
@@ -71,7 +72,7 @@ public class LanguageDetection {
languagesToConsider = List.copyOf(patternsByLanguageBuilder.keySet());
patternsByLanguage = unmodifiableMap(patternsByLanguageBuilder);
- languageCacheByPath = languageCache;
+ languageCacheByPath = new HashMap<>();
}
private static PathPattern[] getLanguagePatterns(Language language) {