From d4d145e532aa487392b1e273e205854f68eb1328 Mon Sep 17 00:00:00 2001 From: Johann Beleites Date: Thu, 29 Aug 2024 17:27:25 +0200 Subject: [PATCH] Modify rules S2259;S2583;S2589;S3518;S3655;S3959 Remove replacement rules and update description for deprecated SE rules (#4207) --- rules/S2259/java/metadata.json | 7 +------ rules/S2259/java/rule.adoc | 4 ++++ rules/S2583/java/metadata.json | 7 +------ rules/S2583/java/rule.adoc | 4 ++++ rules/S2589/java/metadata.json | 7 +------ rules/S2589/java/rule.adoc | 4 ++++ rules/S3518/java/metadata.json | 7 +------ rules/S3518/java/rule.adoc | 4 ++++ rules/S3655/java/metadata.json | 7 +------ rules/S3655/java/rule.adoc | 6 +++++- rules/S3959/java/metadata.json | 8 -------- rules/S3959/java/rule.adoc | 4 ++++ 12 files changed, 30 insertions(+), 39 deletions(-) diff --git a/rules/S2259/java/metadata.json b/rules/S2259/java/metadata.json index fc5e17dd918..4a1c6d50746 100644 --- a/rules/S2259/java/metadata.json +++ b/rules/S2259/java/metadata.json @@ -10,10 +10,5 @@ 476 ] }, - "defaultQualityProfiles": [], - "extra": { - "replacementRules": [ - "RSPEC-6555" - ] - } + "defaultQualityProfiles": [] } diff --git a/rules/S2259/java/rule.adoc b/rules/S2259/java/rule.adoc index 4fa848da100..d89e67703bc 100644 --- a/rules/S2259/java/rule.adoc +++ b/rules/S2259/java/rule.adoc @@ -1,3 +1,7 @@ + +_We are deprecating our legacy symbolic execution engine in favor of our more advanced commercial engine. +The legacy engine will remain Open Source for the community as a separate plugin and will receive no further updates by SonarSource._ + == Why is this an issue? A reference to `null` should never be dereferenced/accessed. diff --git a/rules/S2583/java/metadata.json b/rules/S2583/java/metadata.json index bd2a758b0be..c6f8dbbba86 100644 --- a/rules/S2583/java/metadata.json +++ b/rules/S2583/java/metadata.json @@ -11,10 +11,5 @@ 570 ] }, - "defaultQualityProfiles": [], - "extra": { - "replacementRules": [ - "RSPEC-6651" - ] - } + "defaultQualityProfiles": [] } diff --git a/rules/S2583/java/rule.adoc b/rules/S2583/java/rule.adoc index affc10f4043..46fdb38a221 100644 --- a/rules/S2583/java/rule.adoc +++ b/rules/S2583/java/rule.adoc @@ -1,3 +1,7 @@ + +_We are deprecating our legacy symbolic execution engine in favor of our more advanced commercial engine. +The legacy engine will remain Open Source for the community as a separate plugin and will receive no further updates by SonarSource._ + == Why is this an issue? include::../description.adoc[] diff --git a/rules/S2589/java/metadata.json b/rules/S2589/java/metadata.json index 6110fb50560..f98143d34cc 100644 --- a/rules/S2589/java/metadata.json +++ b/rules/S2589/java/metadata.json @@ -1,10 +1,5 @@ { "status": "deprecated", "tags": [], - "defaultQualityProfiles": [], - "extra": { - "replacementRules": [ - "RSPEC-6646" - ] - } + "defaultQualityProfiles": [] } diff --git a/rules/S2589/java/rule.adoc b/rules/S2589/java/rule.adoc index a43d0ceec53..1331fab9e68 100644 --- a/rules/S2589/java/rule.adoc +++ b/rules/S2589/java/rule.adoc @@ -1,3 +1,7 @@ + +_We are deprecating our legacy symbolic execution engine in favor of our more advanced commercial engine. +The legacy engine will remain Open Source for the community as a separate plugin and will receive no further updates by SonarSource._ + include::../description-common.adoc[] === Code examples diff --git a/rules/S3518/java/metadata.json b/rules/S3518/java/metadata.json index 784c133affd..b33c912aa5d 100644 --- a/rules/S3518/java/metadata.json +++ b/rules/S3518/java/metadata.json @@ -13,10 +13,5 @@ "V-222612" ] }, - "defaultQualityProfiles": [], - "extra": { - "replacementRules": [ - "RSPEC-6649" - ] - } + "defaultQualityProfiles": [] } diff --git a/rules/S3518/java/rule.adoc b/rules/S3518/java/rule.adoc index ac83eff1552..230d1c056b4 100644 --- a/rules/S3518/java/rule.adoc +++ b/rules/S3518/java/rule.adoc @@ -1,4 +1,8 @@ +_We are deprecating our legacy symbolic execution engine in favor of our more advanced commercial engine. +The legacy engine will remain Open Source for the community as a separate plugin and will receive no further updates by SonarSource._ + + If the denominator to an integer division or remainder operation is zero, a `ArithmeticException` is thrown. diff --git a/rules/S3655/java/metadata.json b/rules/S3655/java/metadata.json index d05102a0dad..2b6a01b905d 100644 --- a/rules/S3655/java/metadata.json +++ b/rules/S3655/java/metadata.json @@ -2,10 +2,5 @@ "title": "Optional value should only be accessed after calling isPresent()", "status": "deprecated", "tags": [], - "defaultQualityProfiles": [], - "extra": { - "replacementRules": [ - "RSPEC-6707" - ] - } + "defaultQualityProfiles": [] } diff --git a/rules/S3655/java/rule.adoc b/rules/S3655/java/rule.adoc index 712c1b96e3b..07dc87bb616 100644 --- a/rules/S3655/java/rule.adoc +++ b/rules/S3655/java/rule.adoc @@ -1,6 +1,10 @@ + +_We are deprecating our legacy symbolic execution engine in favor of our more advanced commercial engine. +The legacy engine will remain Open Source for the community as a separate plugin and will receive no further updates by SonarSource._ + == Why is this an issue? -``++Optional++`` value can hold either a value or not. The value held in the ``++Optional++`` can be accessed using the ``++get()++`` method, but it will throw a +``++Optional++`` value can hold either a value or not. The value held in the ``++Optional++`` can be accessed using the ``++get()++`` method, but it will throw a ``++NoSuchElementException++`` if there is no value present. To avoid the exception, calling the ``++isPresent()++`` or ``++! isEmpty()++`` method should always be done before any call to ``++get()++``. diff --git a/rules/S3959/java/metadata.json b/rules/S3959/java/metadata.json index 42be7474488..e6d9749ee7b 100644 --- a/rules/S3959/java/metadata.json +++ b/rules/S3959/java/metadata.json @@ -13,14 +13,6 @@ "constantCost": "10min" }, "tags": [], - "extra": { - "replacementRules": [ - "RSPEC-6976" - ], - "legacyKeys": [ - - ] - }, "defaultSeverity": "Major", "ruleSpecification": "RSPEC-3959", "sqKey": "S3959", diff --git a/rules/S3959/java/rule.adoc b/rules/S3959/java/rule.adoc index 60a962cfbb6..3be8249f579 100644 --- a/rules/S3959/java/rule.adoc +++ b/rules/S3959/java/rule.adoc @@ -1,3 +1,7 @@ + +_We are deprecating our legacy symbolic execution engine in favor of our more advanced commercial engine. +The legacy engine will remain Open Source for the community as a separate plugin and will receive no further updates by SonarSource._ + == Why is this an issue? Stream operations are divided into intermediate and terminal operations, and are combined to form stream pipelines. After the terminal operation is performed, the stream pipeline is considered consumed, and cannot be used again. Such a reuse will yield unexpected results.