| Object and reference immutability using Java generics |
| Full text |
Pdf
(261 KB)
|
Source
|
Foundations of Software Engineering
archive
Proceedings of the the 6th joint meeting of the European software engineering conference and the ACM SIGSOFT symposium on The foundations of software engineering
table of contents
Dubrovnik, Croatia
SESSION: Code analysis
table of contents
Pages: 75 - 84
Year of Publication: 2007
ISBN:978-1-59593-811-4
|
|
Authors
|
|
Yoav Zibin
|
Massachusetts Institute of Technology, Cambridge, MA
|
|
Alex Potanin
|
Victoria University of Wellington, Wellington, New Zealand
|
|
Mahmood Ali
|
Massachusetts Institute of Technology, Cambridge, MA
|
|
Shay Artzi
|
Massachusetts Institute of Technology, Cambridge, MA
|
|
Adam Kie|un
|
Massachusetts Institute of Technology, Cambridge, MA
|
|
Michael D. Ernst
|
Massachusetts Institute of Technology, Cambridge, MA
|
|
| Sponsors |
|
| Publisher |
|
| Bibliometrics |
Downloads (6 Weeks): 8, Downloads (12 Months): 70, Citation Count: 5
|
|
|
ABSTRACT
A compiler-checked immutability guarantee provides useful documentation, facilitates reasoning, and enables optimizations. This paper presents Immutability Generic Java (IGJ), a novel language extension that expresses immutability without changing Java's syntax by building upon Java's generics and annotation mechanisms. In IGJ, each class has one additional type parameter that is Immutable, Mutable, or ReadOnly. IGJ guarantees both reference immutability (only mutable references can mutate an object) and object immutability (an immutable reference points to an immutable object). IGJ is the first proposal for enforcing object immutability within Java's syntax and type system, and its reference immutability is more expressive than previous work. IGJ also permits covariant changes of type parameters in a type-safe manner, e.g., a readonly list of integers is a subtype of a readonly list of numbers. IGJ extends Java's type system with a few simple rules. We formalize this type system and prove it sound. Our IGJ compiler works by type-erasure and generates byte-code that can be executed on any JVM without runtime penalty.
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
|
S. Artzi, M. D. Ernst, A. Kiežun, C. Pacheco, and J. H. Perkins. Finding the needles in the haystack: Generating legal test inputs for object-oriented programs. In M-TOOS, Oct. 2006.
|
 |
2
|
Adrian Birka , Michael D. Ernst, A practical type system and language for reference immutability, Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, October 24-28, 2004, Vancouver, BC, Canada
|
| |
3
|
|
| |
4
|
J. Boyland. Why we should not add readonly to Java (yet). In FTfJP, July 2005.
|
| |
5
|
|
 |
6
|
Gilad Bracha , Martin Odersky , David Stoutamire , Philip Wadler, Making the future safe for the past: adding genericity to the Java programming language, Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, p.183-200, October 18-22, 1998, Vancouver, British Columbia, Canada
|
| |
7
|
Lilian Burdy , Yoonsik Cheon , David R. Cok , Michael D. Ernst , Joseph R. Kiniry , Gary T. Leavens , K. Rustan M. Leino , Erik Poll, An overview of JML tools and applications, International Journal on Software Tools for Technology Transfer (STTT), v.7 n.3, p.212-232, June 2005
[doi> 10.1007/s10009-004-0167-4]
|
 |
8
|
Dave Clarke , Sophia Drossopoulou, Ownership, encapsulation and the disjointness of type and effect, Proceedings of the 17th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, November 04-08, 2002, Seattle, Washington, USA
|
| |
9
|
L. R. Clausen. A Java bytecode optimizer using side-effect analysis. Concurrency: Practice and Experience, 9(11):1031--1045, 1997.
|
 |
10
|
|
| |
11
|
R. DeLine and M. Fähndrich. Typestates for objects. In ECOOP, pages 465--490, June 2004.
|
| |
12
|
W. Dietl and P. Müller. Universes: Lightweight ownership for JML. Journal of Object Technology (JOT), 4(8):5--32, Oct. 2005.
|
| |
13
|
|
| |
14
|
|
| |
15
|
M. D. Ernst and D. Coward. JSR 308: Annotations on Java types. http://pag.csail.mit.edu/jsr308/, Oct. 17, 2006.
|
 |
16
|
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
|
| |
17
|
M. Fowler. Refactoring: Improving the Design of Existing Code. Addison-Wesley, 2000.
|
| |
18
|
|
 |
19
|
|
 |
20
|
|
 |
21
|
|
| |
22
|
|
| |
23
|
Y. Lu and J. Potter. On ownership and accessibility. In ECOOP, pages 99--123, July 2006.
|
| |
24
|
|
 |
25
|
|
| |
26
|
|
 |
27
|
Alex Potanin , James Noble , Dave Clarke , Robert Biddle, Generic ownership for generic Java, Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications, October 22-26, 2006, Portland, Oregon, USA
|
| |
28
|
A. Sǎlcianu. Pointer analysis for Java programs: Novel techniques and applications. PhD thesis, MIT Dept. of EECS, Sept. 2006.
|
| |
29
|
M. Skoglund and T. Wrigstad. A mode system for read-only references in Java. In FTfJP, June 2001.
|
 |
30
|
|
 |
31
|
Matthew S. Tschantz , Michael D. Ernst, Javari: adding reference immutability to Java, Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming, systems, languages, and applications, October 16-20, 2005, San Diego, CA, USA
|
| |
32
|
T. Xie. Augmenting automatically generated unit-test suites with regression oracle checking. In ECOOP, pages 380--403, July 2006.
|
CITED BY 5
|
|
Mahmood Ali , Yoav Zibin , Matt M. Papi , Michael D. Ernst, Enforcing reference and object immutability in Java, Companion to the 23rd ACM SIGPLAN conference on Object oriented programming systems languages and applications, October 19-23, 2008, Nashville, TN, USA
|
|
|
Matthew M. Papi , Mahmood Ali , Telmo Luis Correa, Jr. , Jeff H. Perkins , Michael D. Ernst, Practical pluggable types for java, Proceedings of the 2008 international symposium on Software testing and analysis, July 20-24, 2008, Seattle, WA, USA
|
|
|
|
|
|
|
|
|
Shay Artzi , Adam Kieżun , Jaime Quinonez , Michael D. Ernst, Parameter reference immutability: formal definition, inference tool, and comparison, Automated Software Engineering, v.16 n.1, p.145-192, March 2009
|
|