Class JDBCResourceLeakCodemod

java.lang.Object
io.codemodder.javaparser.JavaParserChanger
io.codemodder.SarifPluginJavaParserChanger<T>
io.codemodder.providers.sarif.codeql.CodeQLSarifJavaParserChanger<com.github.javaparser.ast.expr.MethodCallExpr>
io.codemodder.codemods.JDBCResourceLeakCodemod
All Implemented Interfaces:
io.codemodder.CodeChanger, io.codemodder.FixOnlyCodeChanger

@Codemod(id="codeql:java/database-resource-leak", reviewGuidance=MERGE_WITHOUT_REVIEW, importance=MEDIUM, executionPriority=HIGH) public final class JDBCResourceLeakCodemod extends io.codemodder.providers.sarif.codeql.CodeQLSarifJavaParserChanger<com.github.javaparser.ast.expr.MethodCallExpr>
A codemod for automatically fixing JDBC resource leaks detected by CodeQL's rule "java/database-resource-leak" whenever possible.
  • Field Summary

    Fields inherited from class io.codemodder.SarifPluginJavaParserChanger

    sarif

    Fields inherited from class io.codemodder.javaparser.JavaParserChanger

    reporter
  • Constructor Summary

    Constructors
    Constructor
    Description
    JDBCResourceLeakCodemod(io.codemodder.RuleSarif sarif)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.codemodder.codetf.DetectorRule
     
    io.codemodder.javaparser.ChangesResult
    onResultFound(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.expr.MethodCallExpr methodCallExpr, com.contrastsecurity.sarif.Result result)
     

    Methods inherited from class io.codemodder.providers.sarif.codeql.CodeQLSarifJavaParserChanger

    vendorName

    Methods inherited from class io.codemodder.SarifPluginJavaParserChanger

    shouldRun, supports, visit

    Methods inherited from class io.codemodder.javaparser.JavaParserChanger

    getDescription, getIncludesExcludesPattern, getIndividualChangeDescription, getReferences, getSummary

    Methods inherited from class java.lang.Object

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

    • JDBCResourceLeakCodemod

      @Inject public JDBCResourceLeakCodemod(@ProvidedCodeQLScan(ruleId="java/database-resource-leak") io.codemodder.RuleSarif sarif)
  • Method Details

    • onResultFound

      public io.codemodder.javaparser.ChangesResult onResultFound(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.expr.MethodCallExpr methodCallExpr, com.contrastsecurity.sarif.Result result)
      Specified by:
      onResultFound in class io.codemodder.SarifPluginJavaParserChanger<com.github.javaparser.ast.expr.MethodCallExpr>
    • detectorRule

      public io.codemodder.codetf.DetectorRule detectorRule()