ACM Home Page
Please provide us with feedback. Feedback
Masked types for sound object initialization
Full text PdfPdf (299 KB)
Source
Annual Symposium on Principles of Programming Languages archive
Proceedings of the 36th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages table of contents
Savannah, GA, USA
SESSION: TYPES I table of contents
Pages 53-65  
Year of Publication: 2009
ISBN:978-1-60558-379-2
Also published in ...
Authors
Xin Qi  Cornell University, Ithaca, NY, USA
Andrew C. Myers  Cornell University, Ithaca, NY, USA
Sponsors
ACM: Association for Computing Machinery
SIGACT: ACM Special Interest Group on Algorithms and Computation Theory
SIGPLAN: ACM Special Interest Group on Programming Languages
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 23,   Downloads (12 Months): 147,   Citation Count: 1
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1480881.1480890
What is a DOI?

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
 
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
11
 
12
13
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
 
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
 
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