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

    Fields
    Modifier and Type
    Field
    Description
    A default implementation that should be used in all non-test scenarios.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> io.codemodder.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> findingLineExtractor)
    Visits the provided CompilationUnit and processes findings for potential SQL injections.
  • Field Details

  • Method Details

    • remediateAll

      <T> io.codemodder.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> findingLineExtractor)
      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 scanned
      pathFindings - a collection of findings to be processed
      findingIdExtractor - a function to extract the ID from a finding
      findingLineExtractor - a function to extract the line number from a finding
      Returns:
      a result object containing the changes and unfixed findings