Class ExceptionConstraint

    • Method Detail

      • evaluate

        public void evaluate()
        Evaluates this contraint, by checking if the excepiton if caught for every invokation of the method.
        Specified by:
        evaluate in class EvaluableConstraint
      • evaluate

        public void evaluate​(boomerang.scene.Statement stmt)
        Checks if a) the method that is called is the same as the method of this constraint and b) if the specified exception is caught.
        Parameters:
        stmt - the called statement
      • trapsUnit

        public static boolean trapsUnit​(soot.Body body,
                                        soot.Trap trap,
                                        soot.Unit trapped)
        Returns whether the `trapped` unit is trapped in the method body.
        Parameters:
        body - the method's body
        trap - the trap
        trapped - the trapped unit
        Returns:
        Returns whether the `trapped` unit is trapped in the method body.
      • getTrap

        public static Optional<soot.Trap> getTrap​(soot.Body body,
                                                  soot.Unit unit,
                                                  boomerang.scene.WrappedClass exception)
        Returns the handler, that catches the exception thrown by callee in the method.
        Parameters:
        body - The called Method, throwing the exception.
        unit - Unit where callee is called.
        exception - The called Method, throwing the exception.
        Returns:
        Returns the handler, that catches the exception thrown by callee in the method.
      • getUnits

        public static Collection<soot.Unit> getUnits​(soot.Body body)
        Returns all units in the method body, excluding exception handlers.
        Parameters:
        body - the method's body
        Returns:
        units all collected units
      • isCaughtAs

        public static boolean isCaughtAs​(boomerang.scene.WrappedClass catchClause,
                                         boomerang.scene.WrappedClass exception)
        Returns wheter a catch clause with the given catchClause, would catch the given exception.
        Parameters:
        catchClause - The type of the catch-clause.
        exception - Exception to be caught.
        Returns:
        Wheter a catch clause with the given catchClause, would catch the given exception.
      • isSameMethod

        public boolean isSameMethod​(boomerang.scene.DeclaredMethod method)
        Parameters:
        method - The method to compare againts.
        Returns:
        Wheter the methods represented in this constraint match the given method.