Class SimplifyRestControllerAnnotationsCodemod

java.lang.Object
io.codemodder.javaparser.JavaParserChanger
io.codemodder.providers.sonar.SonarPluginJavaParserChanger<com.github.javaparser.ast.body.ClassOrInterfaceDeclaration>
io.codemodder.codemods.SimplifyRestControllerAnnotationsCodemod
All Implemented Interfaces:
io.codemodder.CodeChanger, io.codemodder.FixOnlyCodeChanger

@Codemod(id="sonar:java/simplify-rest-controller-annotations-s6833", importance=LOW, reviewGuidance=MERGE_WITHOUT_REVIEW, executionPriority=HIGH) public final class SimplifyRestControllerAnnotationsCodemod extends io.codemodder.providers.sonar.SonarPluginJavaParserChanger<com.github.javaparser.ast.body.ClassOrInterfaceDeclaration>
A codemod to replace `@Controller` with `@RestController` and remove `@ResponseBody` annotations
  • Field Summary

    Fields inherited from class io.codemodder.javaparser.JavaParserChanger

    reporter
  • Constructor Summary

    Constructors
    Constructor
    Description
    SimplifyRestControllerAnnotationsCodemod(io.codemodder.providers.sonar.RuleIssues issues)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.codemodder.codetf.DetectorRule
     
    io.codemodder.javaparser.ChangesResult
    onIssueFound(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.body.ClassOrInterfaceDeclaration classOrInterfaceDeclaration, io.codemodder.providers.sonar.api.Issue issue)
     

    Methods inherited from class io.codemodder.providers.sonar.SonarPluginJavaParserChanger

    shouldRun, vendorName, visit

    Methods inherited from class io.codemodder.javaparser.JavaParserChanger

    getDescription, getIndividualChangeDescription, getReferences, getSummary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SimplifyRestControllerAnnotationsCodemod

      @Inject public SimplifyRestControllerAnnotationsCodemod(@ProvidedSonarScan(ruleId="java:S6833") io.codemodder.providers.sonar.RuleIssues issues)
  • Method Details

    • onIssueFound

      public io.codemodder.javaparser.ChangesResult onIssueFound(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.body.ClassOrInterfaceDeclaration classOrInterfaceDeclaration, io.codemodder.providers.sonar.api.Issue issue)
      Specified by:
      onIssueFound in class io.codemodder.providers.sonar.SonarPluginJavaParserChanger<com.github.javaparser.ast.body.ClassOrInterfaceDeclaration>
    • detectorRule

      public io.codemodder.codetf.DetectorRule detectorRule()