From b50db984f07fdfce6a5c8c053d8a86394681463a Mon Sep 17 00:00:00 2001 From: =?utf8?q?L=C3=A9o=20Geoffroy?= Date: Fri, 16 Feb 2024 16:55:14 +0100 Subject: [PATCH] SONAR-21165 Fix code smells --- .../main/java/org/sonar/server/common/rule/RuleCreator.java | 2 +- .../sonar/server/rule/registration/StartupRuleUpdater.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/sonar-webserver-common/src/main/java/org/sonar/server/common/rule/RuleCreator.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/rule/RuleCreator.java index 90513cf5687..f64553b4ecb 100644 --- a/server/sonar-webserver-common/src/main/java/org/sonar/server/common/rule/RuleCreator.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/rule/RuleCreator.java @@ -230,7 +230,7 @@ public class RuleCreator { return ruleDto; } - private void setCleanCodeAttributeAndImpacts(NewCustomRule newRule, RuleDto ruleDto, RuleDto templateRuleDto) { + private static void setCleanCodeAttributeAndImpacts(NewCustomRule newRule, RuleDto ruleDto, RuleDto templateRuleDto) { RuleType ruleType = newRule.type(); int type = ruleType == null ? templateRuleDto.getType() : ruleType.getDbConstant(); String severity = ofNullable(newRule.severity()).orElse(Severity.MAJOR); diff --git a/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/registration/StartupRuleUpdater.java b/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/registration/StartupRuleUpdater.java index 80c41708866..b86603b0cc2 100644 --- a/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/registration/StartupRuleUpdater.java +++ b/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/registration/StartupRuleUpdater.java @@ -161,7 +161,7 @@ public class StartupRuleUpdater { changed = true; } changed |= mergeCleanCodeAttribute(def, dto, ruleChange); - changed |= mergeImpacts(def, dto, uuidFactory, ruleChange); + changed |= mergeImpacts(def, dto, ruleChange); if (dto.isAdHoc()) { dto.setIsAdHoc(false); changed = true; @@ -188,7 +188,7 @@ public class StartupRuleUpdater { return changed; } - boolean mergeImpacts(RulesDefinition.Rule def, RuleDto dto, UuidFactory uuidFactory, RuleChange ruleChange) { + boolean mergeImpacts(RulesDefinition.Rule def, RuleDto dto, RuleChange ruleChange) { if (dto.getEnumType() == RuleType.SECURITY_HOTSPOT) { return false; } -- 2.39.5