Interface JavaParserSQLInjectionRemediatorStrategy
public interface JavaParserSQLInjectionRemediatorStrategy
Strategy interface for remediating SQL injection vulnerabilities using JavaParser.
Implementations of this interface define the method to visit a CompilationUnit and process
findings for potential SQL injections.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JavaParserSQLInjectionRemediatorStrategyA default implementation that should be used in all non-test scenarios. -
Method Summary
Modifier and TypeMethodDescriptionremediateAll(com.github.javaparser.ast.CompilationUnit cu, String path, io.codemodder.codetf.DetectorRule rule, Collection<T> pathFindings, Function<T, String> findingIdExtractor, Function<T, Integer> findingStartLineExtractor, Function<T, Integer> findingEndLineExtractor) Visits the provided CompilationUnit and processes findings for potential SQL injections.
-
Field Details
-
DEFAULT
A default implementation that should be used in all non-test scenarios.
-
-
Method Details
-
remediateAll
<T> CodemodFileScanningResult remediateAll(com.github.javaparser.ast.CompilationUnit cu, String path, io.codemodder.codetf.DetectorRule rule, Collection<T> pathFindings, Function<T, String> findingIdExtractor, Function<T, Integer> findingStartLineExtractor, Function<T, Integer> findingEndLineExtractor) Visits the provided CompilationUnit and processes findings for potential SQL injections.- Type Parameters:
T- the type of the findings- Parameters:
cu- the compilation unit to be scannedpathFindings- a collection of findings to be processedfindingIdExtractor- a function to extract the ID from a findingfindingStartLineExtractor- a function to extract the line number from a finding- Returns:
- a result object containing the changes and unfixed findings
-