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 boolean
match
(com.github.javaparser.ast.expr.MethodCallExpr node) Match code shape for MethodCallExpr casestatic boolean
match
(com.github.javaparser.ast.expr.ObjectCreationExpr node) Match code shape for ObjectCreationExpr casestatic boolean
match
(com.github.javaparser.ast.expr.VariableDeclarationExpr node) Match code shape for AssignExpr casestatic boolean
match
(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:RemediationStrategy
Apply a fix to the issue detected a given node.- Specified by:
fix
in 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:
-