TitleJavari: Adding reference immutability to Java
Publication TypeConference Paper
Year of Publication2005
AuthorsTschantz MS, Ernst MD
Conference NameOOPSLA 2005, Object-Oriented Programming Systems, Languages, and Applications
Pagination211–230
Date or Month PublishedOctober
Conference LocationSan Diego, CA, USA
AbstractThis paper describes a type system that is capable of expressing and enforcing immutability constraints. The specific constraint expressed is that the abstract state of the object to which an immutable reference refers cannot be modified using that reference. The abstract state is (part of) the transitively reachable state: that is, the state of the object and all state reachable from it by following references. The type system permits explicitly excluding fields from the abstract state of an object. For a statically type-safe language, the type system guarantees reference immutability. If the language is extended with immutability downcasts, then run-time checks enforce the reference immutability constraints. \par This research builds upon previous research in language support for reference immutability. Improvements that are new in this paper include distinguishing the notions of assignability and mutability; integration with Java 5's generic types and with multi-dimensional arrays; a mutability polymorphism approach to avoiding code duplication; type-safe support for reflection and serialization; and formal type rules and type soundness proof for a core calculus. Furthermore, it retains the valuable features of the previous dialect, including usability by humans (as evidenced by experience with 160,000 lines of Javari code) and interoperability with Java and existing JVMs.
Downloadshttps://groups.csail.mit.edu/pag/pubs/tschantz-refimmut-mengthesis.pdf extended version (PDF) https://types.cs.washington.edu/javari/ Javari implementation https://homes.cs.washington.edu/~mernst/pubs/ref-immutability-oopsla2005... PDF https://homes.cs.washington.edu/~mernst/pubs/ref-immutability-oopsla2005... slides (PowerPoint)
Citation KeyTschantzE2005