io.codemodder.remediation.jndiinjection.JNDIFixStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codemodder-base Show documentation
Show all versions of codemodder-base Show documentation
Base framework for writing codemods in Java
package io.codemodder.remediation.jndiinjection;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration;
import com.github.javaparser.ast.expr.MethodCallExpr;
import com.github.javaparser.ast.expr.NameExpr;
import com.github.javaparser.ast.stmt.BlockStmt;
import io.codemodder.DependencyGAV;
import java.util.List;
/** Strategy for fixing JNDI injection vulnerabilities. */
interface JNDIFixStrategy {
/**
* Fix the JNDI injection vulnerability.
*
* @param cu the compilation unit
* @param parentClass the parent type (could be nested type)
* @param lookupCall the lookup() method call
* @param blockStmt the block which contains the lookup statement
* @param index the index of the statement in the block
* @param contextNameVariable the variable that holds the JNDI context
* @return the list of dependencies that need to be added to the project
*/
List fix(
CompilationUnit cu,
ClassOrInterfaceDeclaration parentClass,
MethodCallExpr lookupCall,
NameExpr contextNameVariable,
BlockStmt blockStmt,
int index);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy