Skip to content

Commit

Permalink
SONARJAVA-3864 Update S6355 metadata (#3795)
Browse files Browse the repository at this point in the history
  • Loading branch information
quentin-jaquier-sonarsource authored Sep 6, 2021
1 parent 4ac959a commit c8c5131
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.util.stream.Collectors;
import org.sonar.check.Rule;
import org.sonar.java.checks.helpers.QuickFixHelper;
import org.sonar.java.model.JavaTree;
import org.sonar.java.reporting.AnalyzerMessage;
import org.sonar.java.reporting.JavaQuickFix;
import org.sonar.java.reporting.JavaTextEdit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private void reportUnusedParameters(MethodTree methodTree, List<IdentifierTree>
.report();
}

private List<JavaQuickFix> createQuickFixes(MethodTree methodTree, List<IdentifierTree> unused) {
private static List<JavaQuickFix> createQuickFixes(MethodTree methodTree, List<IdentifierTree> unused) {
List<JavaQuickFix> quickFixes = new ArrayList<>();
List<VariableTree> parameters = methodTree.parameters();
for (int i = 0; i < parameters.size(); i++) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
<p>FIXME, see https://github.com/SonarSource/rspec/pull/290</p>
<p>Since Java 9, <code>@Deprecated</code> has two additional arguments to the annotation:</p>
<ul>
<li> <code>since</code> allows you to describe when the deprecation took place </li>
<li> <code>forRemoval</code>, indicates whether the deprecated element will be removed at some future date </li>
</ul>
<p>In order to ease the maintainers work, it is recommended to always add one or both of these arguments.</p>
<p>This rule reports an issue when <code>@Deprecated</code> is used without any argument.</p>
<h2>Noncompliant Code Example</h2>
<pre>
@Deprecated
</pre>
<h2>Compliant Solution</h2>
<pre>
@Deprecated(since="4.2", forRemoval=true)
</pre>
<h2>Exceptions</h2>
<p>The members and methods of a deprecated class or interface are ignored by this rule. The classes and interfaces themselves are still subject to
it.</p>
<h3>See Also</h3>
<ul>
<li> {rule:java:S1123} </li>
</ul>

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-6355",
"sqKey": "S6355",
"scope": "All",
"defaultQualityProfiles": ["Sonar way"]
"scope": "All"
}

0 comments on commit c8c5131

Please sign in to comment.