In object-oriented development environments, software developers have historically had difficulty determining propagated exception types and the reasons for unintended exceptions being caught. This problem may be due to type subsumption or simply to poor documentation, but it affects the developer’s ability to devise recovery procedures or to report unhandled exceptions constructively.
This paper, by Robillard and Murphy, considers a static analysis tool, Jex, which is used to provide exception flow information for Java programs. The exception flow analysis is presented at both the local level (caught exceptions) and global level (the propagation path). More specifically, Jex takes an input set of Java source files, and produces a human-readable file for each class that shows the formatted view of the exception flow for each method of a class. The model used by Jex is based on an earlier (1993) work on Ada. The implementation of Jex is based on an extension to the code of an open source Java compiler. The architecture of Jex is organized around four processes: parsing and type-checking source files, extracting exception flows, performing class-hierarchy analysis to determine dynamic bindings, and loading Jex files for querying.
Situations that require identification of actual exception objects (such as whether an exception thrown in a handler is the same as the one that would be caught by the catch clause) are currently outside the scope of Jex. Three existing software packages were analyzed using Jex, and the results are reported.