Computer-Enforced Immutability for the Java Language

This thesis presents the design, implementation, and evaluation of an extension to the Java language, ConstJava, that is capable of expressing immutability constraints and verifying them at compile time. The specific constraint expressed in ConstJava is that the transitive state of the object to whi...

Full description

Bibliographic Details
Main Author: Birka, Adrian
Published: 2023
Online Access:https://hdl.handle.net/1721.1/149993
_version_ 1811082038870016000
author Birka, Adrian
author_facet Birka, Adrian
author_sort Birka, Adrian
collection MIT
description This thesis presents the design, implementation, and evaluation of an extension to the Java language, ConstJava, that is capable of expressing immutability constraints and verifying them at compile time. The specific constraint expressed in ConstJava is that the transitive state of the object to which a given reference refers cannot be modified using that reference. In addition to the ability to specify and enforce this basic constraint, ConstJava includes several other features, such as mutable fields, immutable classes, templates, and the const cast operator, that make ConstJava a more useful language. The thesis evaluates the utility of ConstJava via experiments involving writing ConstJava code and converting Java code to ConstJava code. The evaluation of ConstJava shows that the language provides tangible benefits in early detection and correction of bugs that would otherwise be difficult to catch. There are also costs associated with the use of ConstJava. These are minimized by ConstJavaÔøΩs backward compatibility with Java, and by the high degree of inter-operability of the two languages, which allows for a less painful transition from Java to ConstJava. This technical report is a revision of the authorÔøΩs MasterÔøΩs thesis, which was advised by Prof. Michael D. Ernst.
first_indexed 2024-09-23T11:56:26Z
id mit-1721.1/149993
institution Massachusetts Institute of Technology
last_indexed 2024-09-23T11:56:26Z
publishDate 2023
record_format dspace
spelling mit-1721.1/1499932023-03-30T03:48:11Z Computer-Enforced Immutability for the Java Language Birka, Adrian This thesis presents the design, implementation, and evaluation of an extension to the Java language, ConstJava, that is capable of expressing immutability constraints and verifying them at compile time. The specific constraint expressed in ConstJava is that the transitive state of the object to which a given reference refers cannot be modified using that reference. In addition to the ability to specify and enforce this basic constraint, ConstJava includes several other features, such as mutable fields, immutable classes, templates, and the const cast operator, that make ConstJava a more useful language. The thesis evaluates the utility of ConstJava via experiments involving writing ConstJava code and converting Java code to ConstJava code. The evaluation of ConstJava shows that the language provides tangible benefits in early detection and correction of bugs that would otherwise be difficult to catch. There are also costs associated with the use of ConstJava. These are minimized by ConstJavaÔøΩs backward compatibility with Java, and by the high degree of inter-operability of the two languages, which allows for a less painful transition from Java to ConstJava. This technical report is a revision of the authorÔøΩs MasterÔøΩs thesis, which was advised by Prof. Michael D. Ernst. 2023-03-29T15:37:34Z 2023-03-29T15:37:34Z 2003-06 https://hdl.handle.net/1721.1/149993 MIT-LCS-TR-908 application/pdf
spellingShingle Birka, Adrian
Computer-Enforced Immutability for the Java Language
title Computer-Enforced Immutability for the Java Language
title_full Computer-Enforced Immutability for the Java Language
title_fullStr Computer-Enforced Immutability for the Java Language
title_full_unstemmed Computer-Enforced Immutability for the Java Language
title_short Computer-Enforced Immutability for the Java Language
title_sort computer enforced immutability for the java language
url https://hdl.handle.net/1721.1/149993
work_keys_str_mv AT birkaadrian computerenforcedimmutabilityforthejavalanguage