Package io.codemodder.codemods
Class UpgradeTempFileToNIOCodemod
java.lang.Object
io.codemodder.javaparser.JavaParserChanger
io.codemodder.SarifPluginJavaParserChanger<com.github.javaparser.ast.expr.MethodCallExpr>
io.codemodder.codemods.UpgradeTempFileToNIOCodemod
- All Implemented Interfaces:
io.codemodder.CodeChanger
@Codemod(id="pixee:java/upgrade-tempfile-to-nio",
importance=MEDIUM,
reviewGuidance=MERGE_WITHOUT_REVIEW)
public final class UpgradeTempFileToNIOCodemod
extends io.codemodder.SarifPluginJavaParserChanger<com.github.javaparser.ast.expr.MethodCallExpr>
Upgrade the
File.createTempFile(String, String)
method to use the NIO version
Files.createTempFile(String, String, FileAttribute[])
.-
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.javaparser.ChangesResult
onResultFound
(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.expr.MethodCallExpr foundCreateTempCall, com.contrastsecurity.sarif.Result result) Methods inherited from class io.codemodder.SarifPluginJavaParserChanger
shouldRun, visit
Methods inherited from class io.codemodder.javaparser.JavaParserChanger
getDescription, getIndividualChangeDescription, getReferences, getSummary
-
Constructor Details
-
UpgradeTempFileToNIOCodemod
@Inject public UpgradeTempFileToNIOCodemod(@SemgrepScan(ruleId="upgrade-tempfile-to-nio") 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 foundCreateTempCall, com.contrastsecurity.sarif.Result result) - Specified by:
onResultFound
in classio.codemodder.SarifPluginJavaParserChanger<com.github.javaparser.ast.expr.MethodCallExpr>
-