diff options
author | Matteo Mara <matteo.mara@sonarsource.com> | 2023-12-20 12:34:14 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-12-21 20:02:33 +0000 |
commit | b6bbc6d5000b3d9bc81e2f8082b451985a7e9145 (patch) | |
tree | 2296044ebaa803ad7cd30f49a679621cc9510c7d /sonar-scanner-engine/src/main | |
parent | b2bf62fd3a2507e05539befb66c6292757b535a4 (diff) | |
download | sonarqube-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.java | 5 |
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) { |