From 0817ca2c1bdc19335f2454d233086778b0013515 Mon Sep 17 00:00:00 2001 From: asya-vorobeva Date: Tue, 16 Jun 2026 16:01:38 +0200 Subject: [PATCH 1/3] Remove 8 rules from SonarWay profile --- .../org/sonar/l10n/java/rules/java/Sonar_way_profile.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/Sonar_way_profile.json b/sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/Sonar_way_profile.json index 31960db62d8..bf91df6c399 100644 --- a/sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/Sonar_way_profile.json +++ b/sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/Sonar_way_profile.json @@ -24,7 +24,6 @@ "S1066", "S1068", "S1075", - "S1104", "S1110", "S1111", "S1113", @@ -45,7 +44,6 @@ "S1141", "S1143", "S1144", - "S1149", "S1150", "S1153", "S1155", @@ -87,7 +85,6 @@ "S1313", "S1317", "S1319", - "S1444", "S1450", "S1452", "S1479", @@ -117,7 +114,6 @@ "S1862", "S1871", "S1872", - "S1874", "S1905", "S1940", "S1948", @@ -199,7 +195,6 @@ "S2274", "S2275", "S2276", - "S2293", "S2326", "S2386", "S2387", @@ -240,7 +235,6 @@ "S2925", "S2970", "S2975", - "S3008", "S3010", "S3011", "S3012", @@ -277,7 +271,6 @@ "S3626", "S3631", "S3706", - "S3740", "S3751", "S3752", "S3753", @@ -531,7 +524,6 @@ "S8469", "S8491", "S8688", - "S8692", "S8694", "S8695", "S8696", From 656b8698ffdd675bbacc448b5bbaaa6493beffc5 Mon Sep 17 00:00:00 2001 From: asya-vorobeva Date: Tue, 16 Jun 2026 16:28:37 +0200 Subject: [PATCH 2/3] Fixed tests --- .../src/test/resources/autoscan/diffs/diff_S1104.json | 6 ------ .../src/test/resources/autoscan/diffs/diff_S1149.json | 6 ------ .../src/test/resources/autoscan/diffs/diff_S1444.json | 6 ------ .../src/test/resources/autoscan/diffs/diff_S1874.json | 6 ------ .../src/test/resources/autoscan/diffs/diff_S2293.json | 6 ------ .../src/test/resources/autoscan/diffs/diff_S3008.json | 6 ------ .../src/test/resources/autoscan/diffs/diff_S3740.json | 6 ------ .../src/test/resources/autoscan/diffs/diff_S8692.json | 6 ------ .../org/sonar/plugins/java/JavaRulesDefinitionTest.java | 2 +- 9 files changed, 1 insertion(+), 49 deletions(-) delete mode 100644 its/autoscan/src/test/resources/autoscan/diffs/diff_S1104.json delete mode 100644 its/autoscan/src/test/resources/autoscan/diffs/diff_S1149.json delete mode 100644 its/autoscan/src/test/resources/autoscan/diffs/diff_S1444.json delete mode 100644 its/autoscan/src/test/resources/autoscan/diffs/diff_S1874.json delete mode 100644 its/autoscan/src/test/resources/autoscan/diffs/diff_S2293.json delete mode 100644 its/autoscan/src/test/resources/autoscan/diffs/diff_S3008.json delete mode 100644 its/autoscan/src/test/resources/autoscan/diffs/diff_S3740.json delete mode 100644 its/autoscan/src/test/resources/autoscan/diffs/diff_S8692.json diff --git a/its/autoscan/src/test/resources/autoscan/diffs/diff_S1104.json b/its/autoscan/src/test/resources/autoscan/diffs/diff_S1104.json deleted file mode 100644 index 2f674a13f00..00000000000 --- a/its/autoscan/src/test/resources/autoscan/diffs/diff_S1104.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ruleKey": "S1104", - "hasTruePositives": true, - "falseNegatives": 0, - "falsePositives": 0 -} \ No newline at end of file diff --git a/its/autoscan/src/test/resources/autoscan/diffs/diff_S1149.json b/its/autoscan/src/test/resources/autoscan/diffs/diff_S1149.json deleted file mode 100644 index f46e69ff4c2..00000000000 --- a/its/autoscan/src/test/resources/autoscan/diffs/diff_S1149.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ruleKey": "S1149", - "hasTruePositives": true, - "falseNegatives": 0, - "falsePositives": 0 -} \ No newline at end of file diff --git a/its/autoscan/src/test/resources/autoscan/diffs/diff_S1444.json b/its/autoscan/src/test/resources/autoscan/diffs/diff_S1444.json deleted file mode 100644 index 33efa572cda..00000000000 --- a/its/autoscan/src/test/resources/autoscan/diffs/diff_S1444.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ruleKey": "S1444", - "hasTruePositives": true, - "falseNegatives": 0, - "falsePositives": 0 -} \ No newline at end of file diff --git a/its/autoscan/src/test/resources/autoscan/diffs/diff_S1874.json b/its/autoscan/src/test/resources/autoscan/diffs/diff_S1874.json deleted file mode 100644 index aa9bb90bf7d..00000000000 --- a/its/autoscan/src/test/resources/autoscan/diffs/diff_S1874.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ruleKey": "S1874", - "hasTruePositives": true, - "falseNegatives": 259, - "falsePositives": 0 -} diff --git a/its/autoscan/src/test/resources/autoscan/diffs/diff_S2293.json b/its/autoscan/src/test/resources/autoscan/diffs/diff_S2293.json deleted file mode 100644 index d6c06ad4a37..00000000000 --- a/its/autoscan/src/test/resources/autoscan/diffs/diff_S2293.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ruleKey": "S2293", - "hasTruePositives": true, - "falseNegatives": 1, - "falsePositives": 0 -} \ No newline at end of file diff --git a/its/autoscan/src/test/resources/autoscan/diffs/diff_S3008.json b/its/autoscan/src/test/resources/autoscan/diffs/diff_S3008.json deleted file mode 100644 index 01a6252a914..00000000000 --- a/its/autoscan/src/test/resources/autoscan/diffs/diff_S3008.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ruleKey": "S3008", - "hasTruePositives": true, - "falseNegatives": 0, - "falsePositives": 0 -} \ No newline at end of file diff --git a/its/autoscan/src/test/resources/autoscan/diffs/diff_S3740.json b/its/autoscan/src/test/resources/autoscan/diffs/diff_S3740.json deleted file mode 100644 index 25661f624e8..00000000000 --- a/its/autoscan/src/test/resources/autoscan/diffs/diff_S3740.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ruleKey": "S3740", - "hasTruePositives": true, - "falseNegatives": 50, - "falsePositives": 0 -} diff --git a/its/autoscan/src/test/resources/autoscan/diffs/diff_S8692.json b/its/autoscan/src/test/resources/autoscan/diffs/diff_S8692.json deleted file mode 100644 index f7cae943320..00000000000 --- a/its/autoscan/src/test/resources/autoscan/diffs/diff_S8692.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ruleKey": "S8692", - "hasTruePositives": true, - "falseNegatives": 0, - "falsePositives": 0 -} \ No newline at end of file diff --git a/sonar-java-plugin/src/test/java/org/sonar/plugins/java/JavaRulesDefinitionTest.java b/sonar-java-plugin/src/test/java/org/sonar/plugins/java/JavaRulesDefinitionTest.java index ad986e3349c..48f101cf569 100644 --- a/sonar-java-plugin/src/test/java/org/sonar/plugins/java/JavaRulesDefinitionTest.java +++ b/sonar-java-plugin/src/test/java/org/sonar/plugins/java/JavaRulesDefinitionTest.java @@ -128,7 +128,7 @@ void test_deprecated_key() { RulesDefinition.Repository repository = context.repository(REPOSITORY_KEY); RulesDefinition.Rule rule = repository.rule("S1104"); - assertThat(rule.activatedByDefault()).isTrue(); + assertThat(rule.activatedByDefault()).isFalse(); assertThat(rule.deprecatedRuleKeys()).containsExactly(RuleKey.of("squid", "ClassVariableVisibilityCheck")); // FIXME SONAR-17167: S4830 should have references to java:S4244 and squid:S4244 From 5dfebf3d1574dd459deb7009d553fd5280e6a5fe Mon Sep 17 00:00:00 2001 From: asya-vorobeva Date: Tue, 16 Jun 2026 16:47:27 +0200 Subject: [PATCH 3/3] Removed also from Sonar agentic AI profile --- .../java/rules/java/Sonar_agentic_AI_profile.json | 6 ------ .../plugins/java/JavaAgenticWayProfileTest.java | 13 ++++++++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/Sonar_agentic_AI_profile.json b/sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/Sonar_agentic_AI_profile.json index ce376d7f611..429745b9109 100644 --- a/sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/Sonar_agentic_AI_profile.json +++ b/sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/Sonar_agentic_AI_profile.json @@ -33,7 +33,6 @@ "S1141", "S1143", "S1144", - "S1149", "S1150", "S1153", "S1155", @@ -73,7 +72,6 @@ "S1313", "S1317", "S1319", - "S1444", "S1450", "S1452", "S1479", @@ -100,7 +98,6 @@ "S1862", "S1871", "S1872", - "S1874", "S1905", "S1940", "S1948", @@ -181,7 +178,6 @@ "S2274", "S2275", "S2276", - "S2293", "S2326", "S2386", "S2387", @@ -222,7 +218,6 @@ "S2925", "S2970", "S2975", - "S3008", "S3010", "S3011", "S3012", @@ -259,7 +254,6 @@ "S3626", "S3631", "S3706", - "S3740", "S3751", "S3752", "S3753", diff --git a/sonar-java-plugin/src/test/java/org/sonar/plugins/java/JavaAgenticWayProfileTest.java b/sonar-java-plugin/src/test/java/org/sonar/plugins/java/JavaAgenticWayProfileTest.java index e9a60db1aec..ad97b05d8c4 100644 --- a/sonar-java-plugin/src/test/java/org/sonar/plugins/java/JavaAgenticWayProfileTest.java +++ b/sonar-java-plugin/src/test/java/org/sonar/plugins/java/JavaAgenticWayProfileTest.java @@ -53,7 +53,7 @@ void profile_is_registered_as_expected() { BuiltInQualityProfilesDefinition.BuiltInQualityProfile actualProfile = profilesPerLanguages.get("java").get("Sonar agentic AI"); assertThat(actualProfile.isDefault()).isFalse(); assertThat(actualProfile.rules()) - .hasSize(470) + .hasSize(464) .extracting(BuiltInQualityProfilesDefinition.BuiltInActiveRule::ruleKey) .doesNotContainAnyElementsOf(List.of( "S101", @@ -67,11 +67,17 @@ void profile_is_registered_as_expected() { "S1104", "S1110", "S1124", + "S1149", "S1195", "S1197", + "S1444", "S1611", "S1659", "S1710", + "S1874", + "S2293", + "S3008", + "S3740", "S4719", "S4838", "S4925", @@ -115,8 +121,9 @@ void profile_is_registered_as_expected() { "S6833", "S6837", "S6912", - "S8491" - )); + "S8491", + "S8692" + )); }