Skip to content

Commit 660c862

Browse files
committed
не мутабельно
1 parent d02f3bf commit 660c862

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/com/github/_1c_syntax/bsl/sonar/language/BSLLanguageServerRuleDefinition.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353

5454
import javax.annotation.CheckForNull;
5555
import java.util.Arrays;
56+
import java.util.Collections;
5657
import java.util.EnumMap;
5758
import java.util.HashMap;
5859
import java.util.List;
@@ -248,7 +249,7 @@ private static Map<DiagnosticSeverity, String> createOldDiagnosticSeverityMap()
248249
map.put(DiagnosticSeverity.CRITICAL, org.sonar.api.rule.Severity.CRITICAL);
249250
map.put(DiagnosticSeverity.BLOCKER, org.sonar.api.rule.Severity.BLOCKER);
250251

251-
return map;
252+
return Collections.unmodifiableMap(map);
252253
}
253254

254255
private static Map<DiagnosticType, RuleType> createRuleTypeMap() {
@@ -258,7 +259,7 @@ private static Map<DiagnosticType, RuleType> createRuleTypeMap() {
258259
map.put(DiagnosticType.VULNERABILITY, RuleType.VULNERABILITY);
259260
map.put(DiagnosticType.SECURITY_HOTSPOT, RuleType.SECURITY_HOTSPOT);
260261

261-
return map;
262+
return Collections.unmodifiableMap(map);
262263
}
263264

264265
private static Map<DiagnosticTag, CleanCodeAttribute> createCleanCodeAttributeMap() {
@@ -277,7 +278,7 @@ private static Map<DiagnosticTag, CleanCodeAttribute> createCleanCodeAttributeMa
277278
map.put(DiagnosticTag.SUSPICIOUS, CleanCodeAttribute.LOGICAL);
278279
map.put(DiagnosticTag.UNPREDICTABLE, CleanCodeAttribute.LOGICAL);
279280
map.put(DiagnosticTag.UNUSED, CleanCodeAttribute.LOGICAL);
280-
return map;
281+
return Collections.unmodifiableMap(map);
281282
}
282283

283284
private static Map<DiagnosticTag, Pair<SoftwareQuality, Severity>> createImpactsMap() {
@@ -296,7 +297,7 @@ private static Map<DiagnosticTag, Pair<SoftwareQuality, Severity>> createImpacts
296297
map.put(DiagnosticTag.SUSPICIOUS, Pair.of(SoftwareQuality.RELIABILITY, Severity.LOW));
297298
map.put(DiagnosticTag.UNPREDICTABLE, Pair.of(SoftwareQuality.RELIABILITY, Severity.MEDIUM));
298299
map.put(DiagnosticTag.UNUSED, Pair.of(SoftwareQuality.MAINTAINABILITY, Severity.INFO));
299-
return map;
300+
return Collections.unmodifiableMap(map);
300301
}
301302

302303
@SneakyThrows

0 commit comments

Comments
 (0)