Abstract
We extend a Java-like language with immutability specifications and a static type system for verifying immutability. A class modifier immutable specifies that all class instances are immutable objects. Ownership types specify the depth of object states and enforce encapsulation of representation objects. The type system guarantees that the state of immutable objects does not visibly mutate during a program run. Provided immutability-annotated classes and methods are final, this is true even if immutable classes are composed with untrusted classes that follow Java’s type system, but not our immutability type system.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Birka, A., Ernst, M.D.: A practical type system and language for reference immutability. In: OOPSLA’04, October 26–28, 2004, pp. 35–49 (2004)
Bloch, J.: Effective Java. Addison-Wesley, Reading (2001)
Boyapati, C., Liskov, B., Shrira, L.: Ownership types for object encapsulation. In: POPL’03, pp. 213–223 (2003)
Clarke, D., Drossopoulou, S.: Ownership, encapsulation and the disjointness of type and effect. In: OOPSLA’02, pp. 292–310 (2002)
Clarke, D., Potter, J., Noble, J.: Ownership types for flexible alias protection. In: OOPSLA’98, pp. 48–64 (1998)
Dietl, W., Müller, P.: Universes: Lightweight ownership for JML. Journal of Object Technology (JOT) 4(8), 5–32 (2005)
Goetz, B.: Java theory and practice: Safe construction techniques–don’t let the ”this” reference escape during construction. IBM DevelopersWork (2002), http://www-106.ibm.com/developerworks/java/library/j-jtp0618.html
Haack, C., et al.: Immutable objects for a Java-like language. Technical report, Radboud University Nijmegen, Forthcoming (2007)
Igarashi, A., Pierce, B., Wadler, P.: Featherweight Java: a minimal core calculus for Java and GJ. ACM TOPLAS 23(3), 396–450 (2001), doi:10.1145/503502.503505
Lu, Y., Potter, J.: On ownership and accessibility. In: Thomas, D. (ed.) ECOOP 2006. LNCS, vol. 4067, pp. 99–123. Springer, Heidelberg (2006)
Lu, Y., Potter, J.: Protecting representation with effect encapsulation. In: POPL’06, pp. 359–371. ACM Press, New York (2006)
Müller, P., Poetzsch-Heffter, A.: Universes: A type system for alias and dependency control. Technical Report 279, Fernuniversität Hagen (2001)
Porat, S., et al.: Automatic detection of immutable fields in Java. In: CASCON’02, IBM Press, Indianapolis (2000)
Pechtchanski, I., Sarkar, V.: Immutability specification and applications. Concurrency and Computation: Practice and Experience 17, 639–662 (2005)
Schäfer, J.: Encapsulation and specification of object-oriented runtime components. Master’s thesis, Technische Universität Kaiserslautern (2004)
Salcianu, A., Rinard, M.C.: Purity and side effect analysis for Java programs. In: Cousot, R. (ed.) VMCAI 2005. LNCS, vol. 3385, pp. 199–215. Springer, Heidelberg (2005)
Tschantz, M.S., Ernst, M.D.: Javari: Adding reference immutability to Java. In: OOPSLA’05, October 18–20, 2005, pp. 211–230 (2005)
Vitek, J., Bokowski, B.: Confined types in Java. Softw. Pract. Exper. 31(6), 507–532 (2001)
Wright, A.K., Felleisen, M.: A syntactic approach to type soundness. Information and Computation 115(1), 38–94 (1994)
Zhao, T., Palsberg, J., Vitek, J.: Type-based confinement. Journal of Functional Programming 16(1), 83–128 (2006)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2007 Springer Berlin Heidelberg
About this paper
Cite this paper
Haack, C., Poll, E., Schäfer, J., Schubert, A. (2007). Immutable Objects for a Java-Like Language. In: De Nicola, R. (eds) Programming Languages and Systems. ESOP 2007. Lecture Notes in Computer Science, vol 4421. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-71316-6_24
Download citation
DOI: https://doi.org/10.1007/978-3-540-71316-6_24
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-71314-2
Online ISBN: 978-3-540-71316-6
eBook Packages: Computer ScienceComputer Science (R0)