Loading...
Please wait, while we are loading the content...
Similar Documents
Javarifier: Inferring Reference Immutability for Java ∗ 6.883: Program Analysis Course Project
| Content Provider | CiteSeerX |
|---|---|
| Author | Sinha, Vineet Tschantz, Matthew Xiao, Chen |
| Abstract | annotate the libraries he plans to use. Otherwise, a reference Reference immutability constraints restrict certain references immutability type checker would be forced to assume that in a program from modifying objects. These constraints, all methods may modify their arguments. Therefore, the such as those provided by the Javari programming language, programmer would be unable to invoke any of the library’s have been shown to increase the expressiveness of a language methods on immutable references even if the method, if fact, and to prevent and detect errors. Unfortunately, annotating existing code, including libraries, with reference immutabil does not modify its arguments. ity constraints is a tedious and error prone task. To aid programmers with adding reference immutability constraints to Java programs, we have created an algorithm to We propose an algorithm for inferring the references in a pro soundly infer immutable references from Java code. For congram that can be declared as readonly romaybe). (or Addicreteness, we use the reference immutability constraints of tionally, to gain additional precision, we introduce heuristics that suggest assignable and mutable fields. Javari [13] (described in section 2). Given a program, our algorithm calculates all the references, To evaluate our algorithm, we have implemented a tool, including local variables, method parameters, static and in Javarifier, to aid programmers in converting Java programs stance fields, that may have Javari’s readonly or romaybe to Javari. We also demonstrate the practicality of our algo keywords added to their declarations. readonly references rithm by using Javarifier to annotate an existing program. cannot be used to modify the abstract state of the object to which it refers (see section 2). romaybe references are used reduce method duplication and cannot be used to modify their referents, but can be passed, via a method’s return value, to the client as a mutable reference (see section 2.3). Using this algorithm, programmers can convert Java programs, including libraries, to Javari. 1. |
| File Format | |
| Access Restriction | Open |
| Subject Keyword | Program Analysis Course Project Inferring Reference Immutability Reference Immutability Constraint Immutable Reference Java Program Aid Programmer Certain Reference Immutability Type Checker Abstract State Method Duplication Language Method Romaybe Reference Detect Error Additional Precision Mutable Reference Method Parameter Java Program Stance Field Algo Keywords Javari Programming Language Error Prone Task Java Code Ity Constraint Mutable Field Reference Reference Immutability Constraint Method Return Value Reference Immutabil Local Variable |
| Content Type | Text |