Repository logo
Log in(current)
Repository logoMIT Open ScholarshipDSpace@MIT
  1. Home
  2. Computer Science and Artificial Intelligence Lab (CSAIL)
  3. CSAIL Digital Archive
  4. CSAIL Technical Reports (July 1, 2003 - present)
  5. Object and Reference Immutability using Java Generics

Object and Reference Immutability using Java Generics

Thumbnail Image
Download
Name

MIT-CSAIL-TR-2007-018.pdf

Size

507.5 KB

Format

Adobe PDF

Checksum (MD5)

4ce6d7fa7de3adba451a4b3502368a65

Thumbnail Image
Download
Name

MIT-CSAIL-TR-2007-018.ps

Size

2.47 MB

Format

PostScript

Checksum (MD5)

106008e6e19b65d821d78a0d3a5c5647

Author(s)
Zibin, Yoav
•
Potanin, Alex
•
Artzi, Shay
•
Kiezun, Adam
•
Ernst, Michael D.
Advisor(s)
Michael Ernst
Date Issued
March 16, 2007
Series/Report no.
Massachusetts Institute of Technology Computer Science and Artificial Intelligence Laboratory
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 generic 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, and its reference immutability is more expressive than previous work. IGJ also permits covariant changes of generic arguments 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.
Persistent DSpace Link
http://hdl.handle.net/1721.1/36850
Repository logo
PrivacyPermissionsAccessibilityContact us
Repository logo
Notify us about copyright concerns.