Class JavaDeserializationFixStrategy

java.lang.Object
io.codemodder.remediation.javadeserialization.JavaDeserializationFixStrategy
All Implemented Interfaces:
RemediationStrategy

public final class JavaDeserializationFixStrategy extends Object implements RemediationStrategy
Default strategy to hardens deserialization vulnerabilities.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    fix(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 case
    static boolean
    match(com.github.javaparser.ast.expr.ObjectCreationExpr node)
    Match code shape for ObjectCreationExpr case
    static boolean
    match(com.github.javaparser.ast.expr.VariableDeclarationExpr node)
    Match code shape for AssignExpr case
    static boolean
    match(com.github.javaparser.ast.Node node)
    Default matching

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 interface RemediationStrategy
      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: