|
ABSTRACT
This paper presents a type-based solution to the long-standing problem of object initialization. Constructors, the conventional mechanism for object initialization, have semantics that are surprising to programmers and that lead to bugs. They also contribute to the problem of null-pointer exceptions, which make software less reliable. Masked types are a new type-state mechanism that explicitly tracks the initialization state of objects and prevents reading from uninitialized fields. In the resulting language, constructors are ordinary methods that operate on uninitialized objects, and no special default value (null) is needed in the language. Initialization of cyclic data structures is achieved with the use of conditionally masked types. Masked types are modular and compatible with data abstraction. The type system is presented in a simplified object calculus and is proved to soundly prevent reading from uninitialized fields. Masked types have been implemented as an extension to Java, in which compilation simply erases extra type information. Experience using the extended language suggests that masked types work well on real code.
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
|
|
| |
2
|
Patrice Chalin and Perry James. Non-null references by default in Java: Alleviating the nullity annotation burden. In Proceedings of the 21st European Conference on Object-Oriented Programming, 2007.
|
| |
3
|
Sigmund Cherem and Radu Rugina. Maintaining doubly-linked list invariants in shape analysis with local reasoning. In Verification, Model Checking, and Abstract Interpretation, 8th International Conference (VMCAI 2007), Nice, France, January 2007.
|
 |
4
|
|
| |
5
|
Robert DeLine and Manuel Fähndrich. Typestates for objects. In Proceedings of 18th European Conference on Object-Oriented Programming (ECOOP'04), 2004.
|
| |
6
|
Torbjörn Ekman and G¨orel Hedin. Pluggable checking and inferencing of non-null types for java. Journal of Object Technology, 6(9):455--475, October 2007.
|
 |
7
|
Manuel Fähndrich , K. Rustan M. Leino, Declaring and checking non-null types in an object-oriented language, Proceedings of the 18th annual ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applications, October 26-30, 2003, Anaheim, California, USA
|
| |
8
|
Manuel Fähndrich and K. Rustan M. Leino. Heap monotonic typestate. In Proceedings of the first International Workshop on Alias Confinement and Ownership (IWACO), July 2003.
|
 |
9
|
|
 |
10
|
Stephen Fink , Eran Yahav , Nurit Dor , G. Ramalingam , Emmanuel Geay, Effective typestate verification in the presence of aliasing, Proceedings of the 2006 international symposium on Software testing and analysis, July 17-20, 2006, Portland, Maine, USA
[doi> 10.1145/1146238.1146254]
|
 |
11
|
|
| |
12
|
|
 |
13
|
David Hovemeyer , William Pugh, Finding bugs is easy, Companion to the 19th annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications, October 24-28, 2004, Vancouver, BC, CANADA
[doi> 10.1145/1028664.1028717]
|
 |
14
|
|
| |
15
|
Atsushi Igarashi and Benjamin C. Pierce. On inner classes. In Informal Proceedings of the Seventh International Workshop on Foundations of Object-Oriented Languages (FOOL 7), Boston, MA, January 2000.
|
| |
16
|
ECMA International. Eiffel analysis, design and programming language. ECMA Standard 367, June 2005.
|
| |
17
|
Haskell 98: A non-strict, purely functional language, February 1999. Available at http://www.haskell.org/onlinereport/.
|
 |
18
|
|
| |
19
|
JSR 308: Annotations on Java Types. Available at http://groups.csail.mit.edu/pag/jsr308/.
|
 |
20
|
K. Rustan M. Leino, Data groups: specifying the modification of extended state, Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, p.144-153, October 18-22, 1998, Vancouver, British Columbia, Canada
|
| |
21
|
B. Liskov and J. Guttag. Data abstraction. In Abstraction and Specification in Program Development, chapter 4, pages 56--98. MIT Press and McGraw Hill, 1986.
|
| |
22
|
Barbara Liskov, Dorothy Curtis, Mark Day, Sanjay Ghemawat, Robert Gruber, Paul Johnson, and Andrew C. Myers. Theta Reference Manual. Programming Methodology Group Memo 88, MIT Laboratory for Computer Science, Cambridge, MA, February 1994. Available at http://www.pmg.lcs.mit.edu/papers/thetaref/.
|
 |
23
|
|
| |
24
|
|
 |
25
|
|
| |
26
|
Nathaniel Nystrom, Michael R. Clarkson, and Andrew C. Myers. Polyglot: An extensible compiler framework for Java. In Proc. 12th International Compiler Construction Conference (CC'03), pages 138--152, April 2003. LNCS 2622.
|
| |
27
|
Xin Qi and Andrew C. Myers. Masked types. Technical report, Computer and Information Science, Cornell University, October 2008. http://hdl.handle.net/1813/11563.
|
 |
28
|
Joel Richardson , Peter Schwarz , Luis-Felipe Cabrera, CACL: efficient fine-grained protection for objects, conference proceedings on Object-oriented programming systems, languages, and applications, p.263-275, October 18-22, 1992, Vancouver, British Columbia, Canada
|
| |
29
|
|
 |
30
|
|
| |
31
|
|
| |
32
|
Sun Microsystems. Java Language Specification, version 1.0 beta edition, October 1995. Available at ftp://ftp.javasoft.com/docs/javaspec.ps.zip.
|
| |
33
|
Don Syme. Initializing mutually referential abstract objects: The value recursion challenge. Electronic Notes in Theoretical Computer Science, 148(2):3--25, 2006.
|
| |
34
|
|
| |
35
|
|
|