Class JavaDeserializationFixStrategy
java.lang.Object
io.codemodder.remediation.javadeserialization.JavaDeserializationFixStrategy
- All Implemented Interfaces:
RemediationStrategy
Default strategy to hardens deserialization vulnerabilities.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfix(com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.Node node) Apply a fix to the issue detected a given node.static booleanmatch(com.github.javaparser.ast.expr.MethodCallExpr node) Match code shape for MethodCallExpr casestatic booleanmatch(com.github.javaparser.ast.expr.ObjectCreationExpr node) Match code shape for ObjectCreationExpr casestatic booleanmatch(com.github.javaparser.ast.expr.VariableDeclarationExpr node) Match code shape for AssignExpr casestatic booleanmatch(com.github.javaparser.ast.Node node) Default matching
-
Constructor Details
-
JavaDeserializationFixStrategy
public JavaDeserializationFixStrategy()
-
-
Method Details
-
fix
public SuccessOrReason fix(com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.Node node) Description copied from interface:RemediationStrategyApply a fix to the issue detected a given node.- Specified by:
fixin interfaceRemediationStrategy- Returns:
- A SuccessOrReason object containing a list of dependencies if the fix was successful, or a reason for failure otherwise
-
match
public static boolean match(com.github.javaparser.ast.expr.VariableDeclarationExpr node) Match code shape for AssignExpr case- Parameters:
node-- Returns:
-
match
public static boolean match(com.github.javaparser.ast.expr.ObjectCreationExpr node) Match code shape for ObjectCreationExpr case- Parameters:
node-- Returns:
-
match
public static boolean match(com.github.javaparser.ast.expr.MethodCallExpr node) Match code shape for MethodCallExpr case- Parameters:
node-- Returns:
-
match
public static boolean match(com.github.javaparser.ast.Node node) Default matching- Parameters:
node-- Returns:
-