Class RemoveUselessParenthesesCodemod

java.lang.Object
io.codemodder.javaparser.JavaParserChanger
io.codemodder.providers.sonar.SonarPluginJavaParserChanger<com.github.javaparser.ast.expr.EnclosedExpr>
io.codemodder.codemods.RemoveUselessParenthesesCodemod
All Implemented Interfaces:
io.codemodder.CodeChanger

@Codemod(id="sonar:java/remove-useless-parentheses-s1110", reviewGuidance=MERGE_WITHOUT_REVIEW, importance=LOW, executionPriority=HIGH) public final class RemoveUselessParenthesesCodemod extends io.codemodder.providers.sonar.SonarPluginJavaParserChanger<com.github.javaparser.ast.expr.EnclosedExpr>
Codemod to remove useless pair of parentheses
  • Field Summary

    Fields inherited from class io.codemodder.javaparser.JavaParserChanger

    reporter
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    boolean
    onIssueFound(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.expr.EnclosedExpr enclosedExpr, io.codemodder.providers.sonar.api.Issue issue)
     

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

    shouldRun, visit

    Methods inherited from class io.codemodder.javaparser.JavaParserChanger

    dependenciesRequired, getDescription, getIndividualChangeDescription, getReferences, getSummary

    Methods inherited from class java.lang.Object

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

    • RemoveUselessParenthesesCodemod

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

    • onIssueFound

      public boolean onIssueFound(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.expr.EnclosedExpr enclosedExpr, io.codemodder.providers.sonar.api.Issue issue)
      Specified by:
      onIssueFound in class io.codemodder.providers.sonar.SonarPluginJavaParserChanger<com.github.javaparser.ast.expr.EnclosedExpr>