Class ThrowableAnalysis
- java.lang.Object
-
- com.ensoftcorp.open.java.commons.analysis.ThrowableAnalysis
-
public class ThrowableAnalysis extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.ensoftcorp.atlas.core.query.QfindCatchForThrows(com.ensoftcorp.atlas.core.query.Q input)Given a method or a control flow block which throws an exception, returns a graph showing the matching catch blocks.static com.ensoftcorp.atlas.core.query.QfindThrowForCatch(com.ensoftcorp.atlas.core.query.Q input)Given a method or control flow block which catches exceptions, returns a graph showing the matching throw statements.static com.ensoftcorp.atlas.core.query.QgetCheckedExceptions()Returns all checked exceptions Checked exceptions extend the Exception type, but do not extend the RuntimeException typestatic com.ensoftcorp.atlas.core.query.QgetCheckedThrowables()Returns all checked Throwable typesstatic com.ensoftcorp.atlas.core.query.QgetErrors()Returns all Error types Errors are unchecked Throwable types that subclass Errorstatic com.ensoftcorp.atlas.core.query.QgetThrowables()Returns all Throwable types Throwable types are checked, except for subclasses of Error and RuntimeException typesstatic com.ensoftcorp.atlas.core.query.QgetUncheckedExceptions()Returns all unchecked Exceptions Unchecked exceptions extend the RuntimeException typestatic com.ensoftcorp.atlas.core.query.QgetUncheckedThrowables()Returns all unchecked Throwable typesstatic com.ensoftcorp.atlas.core.query.Qstack(com.ensoftcorp.atlas.core.query.Q context, com.ensoftcorp.atlas.core.query.Q origin, com.ensoftcorp.atlas.core.script.CommonQueries.TraversalDirection direction)Builds a "stack graph".static com.ensoftcorp.atlas.core.query.Qstack(com.ensoftcorp.atlas.core.query.Q origin, com.ensoftcorp.atlas.core.script.CommonQueries.TraversalDirection direction)Builds a "stack graph".
-
-
-
Method Detail
-
getThrowables
public static com.ensoftcorp.atlas.core.query.Q getThrowables()
Returns all Throwable types Throwable types are checked, except for subclasses of Error and RuntimeException types- Returns:
-
getCheckedThrowables
public static com.ensoftcorp.atlas.core.query.Q getCheckedThrowables()
Returns all checked Throwable types- Returns:
-
getUncheckedThrowables
public static com.ensoftcorp.atlas.core.query.Q getUncheckedThrowables()
Returns all unchecked Throwable types- Returns:
-
getErrors
public static com.ensoftcorp.atlas.core.query.Q getErrors()
Returns all Error types Errors are unchecked Throwable types that subclass Error- Returns:
-
getCheckedExceptions
public static com.ensoftcorp.atlas.core.query.Q getCheckedExceptions()
Returns all checked exceptions Checked exceptions extend the Exception type, but do not extend the RuntimeException type- Returns:
-
getUncheckedExceptions
public static com.ensoftcorp.atlas.core.query.Q getUncheckedExceptions()
Returns all unchecked Exceptions Unchecked exceptions extend the RuntimeException type- Returns:
-
stack
public static com.ensoftcorp.atlas.core.query.Q stack(com.ensoftcorp.atlas.core.query.Q origin, com.ensoftcorp.atlas.core.script.CommonQueries.TraversalDirection direction)Builds a "stack graph". A stack graph combines CALL (per cf), CONTROL_FLOW, and DECLARES edges to build a complete call graph at the level of PER_CONTRO_FLOW. Ordinarily, this would have to be done piecewise. Intended use: You have a control flow block X where something interesting happens, and you want to find other control flow blocks Y which are in stacks starting at X that have something else interesting. Use this to flow forward and find Y. Operates in the index context.- Parameters:
origin-direction-- Returns:
-
stack
public static com.ensoftcorp.atlas.core.query.Q stack(com.ensoftcorp.atlas.core.query.Q context, com.ensoftcorp.atlas.core.query.Q origin, com.ensoftcorp.atlas.core.script.CommonQueries.TraversalDirection direction)Builds a "stack graph". A stack graph combines CALL (per cf), CONTROL_FLOW, and DECLARES edges to build a complete call graph at the level of PER_CONTRO_FLOW. Ordinarily, this would have to be done piecewise. Intended use: You have a control flow block X where something interesting happens, and you want to find other control flow blocks Y which are in stacks starting at X that have something else interesting. Use this to flow forward and find Y. Operates in the given context.- Parameters:
context-origin-direction-- Returns:
-
findCatchForThrows
public static com.ensoftcorp.atlas.core.query.Q findCatchForThrows(com.ensoftcorp.atlas.core.query.Q input)
Given a method or a control flow block which throws an exception, returns a graph showing the matching catch blocks. Operates within the given context.- Parameters:
context-input-- Returns:
-
findThrowForCatch
public static com.ensoftcorp.atlas.core.query.Q findThrowForCatch(com.ensoftcorp.atlas.core.query.Q input)
Given a method or control flow block which catches exceptions, returns a graph showing the matching throw statements. Operates within the given context.- Parameters:
context-input-- Returns:
-
-