New exception interfaces for Java-like languages

  • Authors:
  • Thiago B. L. Silva;Fernando Castor

  • Affiliations:
  • Informatics Center, Federal University of Pernambuco, Recife-PE, Brazil;Informatics Center, Federal University of Pernambuco, Recife-PE, Brazil

  • Venue:
  • Proceedings of the 28th Annual ACM Symposium on Applied Computing
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

The Java programming language allows developers to specify the exception interface of a method using the throws clause. This mechanism supports static checking that is coherent with a statically-typed language. However, it is known to have limitations. In particular, throws clauses hinder understandability and maintainability due to their scattered nature and lack of information about the source of an exception, the place where it is handled, and everything in between. In this paper, we propose a simple form of exception interface specification, called Exception Propagation Channel (EPC), that provides a global view of exception flow and complements Java's exception interfaces. Our approach stems from the observation that throws clauses scale well for methods that throw exceptions to large numbers of direct callers (horizontally), but not for long chains of method calls (vertically). We present an extension to the Java language, called EPiC-Java that incorporates the proposed approach as well as a prototype compiler and a reengineering tool for that extension. Application of the proposed approach to three open-source systems resulted in a considerable reduction in the number of throws clauses and a comparatively smaller number of EPCs, thus suggesting that maintainability is improved.