|
ABSTRACT
Ever since their invention 30 years ago, checked exceptions have been a point of much discussion. On the one hand, they increase the robustness of software by preventing the manifestation of unanticipated checked exceptions at run-time. On the other hand, they decrease the adaptability of software because they must be propagated explicitly, and must often be handled even if they cannot be signalled.We show that the problems with checked exceptions are caused by a lack of expressiveness of the exceptional return type of a method, which currently dictates a copy & paste style. We add the required expressiveness by introducing anchored exception declarations, which allow the exceptional behavior of a method to be declared relative to that of others. We present the formal semantics of anchored exception declarations, along with the necessary rules for ensuring compile-time safety, and give a proof of soundness. We show that anchored exception declarations do not violate the principle of information hiding when used properly, and provide a guideline for when to use them.We have implemented anchored exception declarations in Cappuccino, which is an extension to the ClassicJava programming language.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
J. Aldrich and K. Donnelly. Selective open recursion: Modular reasoning about components and inheritance. In Proc. FSE 2004 Workshop on Specification and Verification of Component-Based Systems.
|
 |
2
|
|
| |
3
|
M. Barnett, K. R. M. Leino, and W. Schulte. The Spec# programming system: An overview. In CASSIS 2004 proceedings, 2004.
|
| |
4
|
|
 |
5
|
Byeong-Mo Chang , Jang-Wu Jo , Kwangkeun Yi , Kwang-Moo Choe, Interprocedural exception analysis for Java, Proceedings of the 2001 ACM symposium on Applied computing, p.620-625, March 2001, Las Vegas, Nevada, United States
[doi> 10.1145/372202.372786]
|
| |
6
|
|
 |
7
|
Jong-Deok Choi , David Grove , Michael Hind , Vivek Sarkar, Efficient and precise modeling of exceptions for the analysis of Java programs, Proceedings of the 1999 ACM SIGPLAN-SIGSOFT workshop on Program analysis for software tools and engineering, p.21-31, September 06-06, 1999, Toulouse, France
|
 |
8
|
|
| |
9
|
ECMA Technical Committee 39 (TC39) Task Group 2 (TG2). C# Language Specification. ECMA, 2 edition, December 2002.
|
| |
10
|
|
| |
11
|
M. Fähndrich and A. Aiken. Refined type inference for ML. In Proceedings of the 1st Workshop on Types in Compilation, June 1997.
|
| |
12
|
|
 |
13
|
Matthew Flatt , Shriram Krishnamurthi , Matthias Felleisen, Classes and mixins, Proceedings of the 25th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.171-183, January 19-21, 1998, San Diego, California, United States
[doi> 10.1145/268946.268961]
|
| |
14
|
|
| |
15
|
|
 |
16
|
Kevin Glynn , Peter J. Stuckey , Martin Sulzmann , Harald Søndergaard, Exception analysis for non-strict languages, Proceedings of the seventh ACM SIGPLAN international conference on Functional programming, p.98-109, October 04-06, 2002, Pittsburgh, PA, USA
|
 |
17
|
|
| |
18
|
James Gosling , Bill Joy , Guy Steele , Gilad Bracha, Java Language Specification, Second Edition: The Java Series, Addison-Wesley Longman Publishing Co., Inc., Boston, MA, 2000
|
| |
19
|
J. Guzmán and A. Suárez. An Extended Type System for Exceptions. In Record of the fifth ACM SIGPLAN workshop on ML and its Applications, June 1994. Also appears as Research Report 2265, INRIA, BP 105 - 78153 Le Chesnay Cedex, France.
|
| |
20
|
A. Hejlsberg. The trouble with checked exceptions. http://www.artima.com/intv/handcuffs.html.
|
 |
21
|
Richard Helm , Ian M. Holland , Dipayan Gangopadhyay, Contracts: specifying behavioral compositions in object-oriented systems, Proceedings of the European conference on object-oriented programming on Object-oriented programming systems, languages, and applications, p.169-180, September 1990, Ottawa, Canada
|
 |
22
|
|
| |
23
|
|
| |
24
|
|
 |
25
|
Simon Peyton Jones , Alastair Reid , Fergus Henderson , Tony Hoare , Simon Marlow, A semantics for imprecise exceptions, Proceedings of the ACM SIGPLAN 1999 conference on Programming language design and implementation, p.25-36, May 01-04, 1999, Atlanta, Georgia, United States
|
 |
26
|
John Lamping, Typing the specialization interface, Proceedings of the eighth annual conference on Object-oriented programming systems, languages, and applications, p.201-214, September 26-October 01, 1993, Washington, D.C., United States
|
| |
27
|
G. T. Leavens, A. L. Baker, and C. Ruby. Preliminary design of JML: A behavioral interface specification language for Java. Technical Report 98-06i, 2000.
|
| |
28
|
|
| |
29
|
M. Lippert and C. Lopes. A study on exception detection and handling using aspect-oriented programming. Technical report, Xerox PARC, 1999.
|
| |
30
|
|
| |
31
|
|
| |
32
|
|
| |
33
|
B. Meyer. Overloading vs. object technology. Journal of Object-Oriented Programming, October 2001.
|
| |
34
|
|
| |
35
|
R. Miller and A. Tripathi. Issues with exception handling in object-oriented systems. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP '97), volume 1241 of LNCS, page 85, Jyväskylä, Finland, June 1997. Springer.
|
| |
36
|
|
 |
37
|
|
| |
38
|
|
 |
39
|
|
 |
40
|
|
 |
41
|
|
 |
42
|
|
| |
43
|
|
| |
44
|
|
| |
45
|
|
| |
46
|
|
| |
47
|
N. Smeets and M. van Dooren. Jnome, 2004. http://www.jnome.org.
|
 |
48
|
Patrick Steyaert , Carine Lucas , Kim Mens , Theo D'Hondt, Reuse contracts: managing the evolution of reusable assets, Proceedings of the 11th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, p.268-285, October 06-10, 1996, San Jose, California, United States
|
| |
49
|
M. van Dooren and E. Steegmans. Combining the robustness of checked exceptions with the flexibility of unchecked exceptions using anchored exception declarations. Technical Report CW 407, Katholieke Universiteit Leuven, March 2005.
|
| |
50
|
|
| |
51
|
W. Winston. Operations Research: Applications and Algorithms. Duxbury, 2003.
|
 |
52
|
|
 |
53
|
|
| |
54
|
K. Yi. Compile-time detection of uncaught exceptions in standard ML programs. In The 1st International Static Analysis Symposium, volume 864 of Lecture Notes in Computer Science, pages 238--254, Namur, September 1994.
|
| |
55
|
|
| |
56
|
|
CITED BY 4
|
|
Marko van Dooren , Eric Steegmans, Language constructs for improving reusability in object-oriented software, Companion to the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, October 16-20, 2005, San Diego, CA, USA
|
|
|
Fernando Castor Filho , Nelio Cacho , Eduardo Figueiredo , Raquel Maranhão , Alessandro Garcia , Cecília Mary F. Rubira, Exceptions and aspects: the devil is in the details, Proceedings of the 14th ACM SIGSOFT international symposium on Foundations of software engineering, November 05-11, 2006, Portland, Oregon, USA
|
|
|
|
|
|
|
|