Exception Handling with Resumption: Design and Implementation in Java

Nowadays, nearly every mainstram programming language includes an exception handling mechanism. Basically, the variety of these mechanisms can be devided in two groups according to their handling models: Mechanisms which support exception termination and those which support resumption. Even though resumption was still an attractive alternative to termination for the first exception handling mechanisms in the 1980s, it has nearly been displaced completely in contemporary languages by termination. Some reasons for this trend will be reviewed in this work. But in our opinion, they do not justify to reject resumption completely. To the contrary, resumption can simplify some tasks extremely while still being implementable with reasonable effort. To show this, we discuss some basic concepts of how a resumption mechanism should be designed in general and propose new syntactical constructs to support these concepts. Based on these concepts, we describe the implementation of a prototypical precompiler for Java supporting exception handling with resumption. In fact, the mechanism implemented in the precompiler not only extends, but completely subsumes the Java mechanism, for it is capable of both, termination and resumption. KEYWORDS— Flexible Exception Handling, Java, Resumption, Prototypical Implementation, Precompiler.