Package io.codemodder.codemods
Class FixRedundantStaticOnEnumCodemod
java.lang.Object
io.codemodder.javaparser.JavaParserChanger
io.codemodder.providers.sonar.SonarPluginJavaParserChanger<com.github.javaparser.ast.body.EnumDeclaration>
io.codemodder.codemods.FixRedundantStaticOnEnumCodemod
- All Implemented Interfaces:
io.codemodder.CodeChanger
,io.codemodder.FixOnlyCodeChanger
@Codemod(id="sonar:java/remove-redundant-static-s2786",
reviewGuidance=MERGE_WITHOUT_REVIEW,
importance=LOW,
executionPriority=HIGH)
public final class FixRedundantStaticOnEnumCodemod
extends io.codemodder.providers.sonar.SonarPluginJavaParserChanger<com.github.javaparser.ast.body.EnumDeclaration>
A codemod for automatically removing redundant static flags on nested enums.
-
Field Summary
Fields inherited from class io.codemodder.javaparser.JavaParserChanger
reporter
-
Constructor Summary
ConstructorsConstructorDescriptionFixRedundantStaticOnEnumCodemod
(io.codemodder.providers.sonar.RuleIssues issues) -
Method Summary
Modifier and TypeMethodDescriptionprotected io.codemodder.codetf.DetectorRule
io.codemodder.javaparser.ChangesResult
onIssueFound
(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.body.EnumDeclaration enumDecl, io.codemodder.providers.sonar.api.Issue issue) Methods inherited from class io.codemodder.providers.sonar.SonarPluginJavaParserChanger
getDetectionTool, shouldRun, visit
Methods inherited from class io.codemodder.javaparser.JavaParserChanger
getDescription, getIndividualChangeDescription, getReferences, getSummary
-
Constructor Details
-
FixRedundantStaticOnEnumCodemod
@Inject public FixRedundantStaticOnEnumCodemod(@ProvidedSonarScan(ruleId="java:S2786") io.codemodder.providers.sonar.RuleIssues issues)
-
-
Method Details
-
getDetectorRule
protected io.codemodder.codetf.DetectorRule getDetectorRule()- Specified by:
getDetectorRule
in classio.codemodder.providers.sonar.SonarPluginJavaParserChanger<com.github.javaparser.ast.body.EnumDeclaration>
-
onIssueFound
public io.codemodder.javaparser.ChangesResult onIssueFound(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.body.EnumDeclaration enumDecl, io.codemodder.providers.sonar.api.Issue issue) - Specified by:
onIssueFound
in classio.codemodder.providers.sonar.SonarPluginJavaParserChanger<com.github.javaparser.ast.body.EnumDeclaration>
-