Package io.codemodder.codemods.codeql
Class CodeQLInputResourceLeakCodemod
java.lang.Object
io.codemodder.javaparser.JavaParserChanger
io.codemodder.SarifPluginJavaParserChanger<T>
io.codemodder.providers.sarif.codeql.CodeQLSarifJavaParserChanger<com.github.javaparser.ast.expr.Expression>
io.codemodder.codemods.codeql.CodeQLInputResourceLeakCodemod
- All Implemented Interfaces:
io.codemodder.CodeChanger
,io.codemodder.FixOnlyCodeChanger
@Codemod(id="codeql:java/input-resource-leak",
reviewGuidance=MERGE_WITHOUT_REVIEW,
importance=MEDIUM,
executionPriority=HIGH)
public final class CodeQLInputResourceLeakCodemod
extends io.codemodder.providers.sarif.codeql.CodeQLSarifJavaParserChanger<com.github.javaparser.ast.expr.Expression>
A codemod for automatically fixing input resource leaks detected by CodeQL's rule
"java/input-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 -
Method Summary
Modifier and TypeMethodDescriptionio.codemodder.codetf.DetectorRule
io.codemodder.javaparser.ChangesResult
onResultFound
(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.expr.Expression expr, 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
-
Constructor Details
-
CodeQLInputResourceLeakCodemod
@Inject public CodeQLInputResourceLeakCodemod(@ProvidedCodeQLScan(ruleId="java/input-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.Expression expr, com.contrastsecurity.sarif.Result result) - Specified by:
onResultFound
in classio.codemodder.SarifPluginJavaParserChanger<com.github.javaparser.ast.expr.Expression>
-
detectorRule
public io.codemodder.codetf.DetectorRule detectorRule()
-