Automatic detection of immutable fields in Java
Sara Porat, Marina Biberstein, Larry Koved et al. · 2000
This paper introduces techniques to detect mutability of fields and classes in Java. A variable is considered to be mutable if a new value is stored into it, as well as if any of its reachable variables is mutable. We present a static flow-sensitive analysis algorithm which can be applied to any Java component. The analysis classifies fields and classes as either mutable or immutable. In order to facilitate openworld analysis, the algorithm identifies situations that expose variables to potential modification by code outside the component, as well as situations where variables are modified by the analyzed code. We also present an implementation of the analysis which focuses on detecting mutability of class variables, so as to avoid isolation problems. The implementation incorporates intra- and inter-procedural data-flow analyses and is shown to be highly scalable. Experimental results demonstrate the effectiveness of the algorithms.
Cited by 42 works.
Authors
References
- Java Virtual Machine Specification
- The Definition of Standard ML
- Extended static checking
- The Definition of Standard ML (Revised)
- Context-sensitive interprocedural points-to analysis in the presence of function pointers
- Escape analysis for Java
- Compositional pointer and escape analysis for Java programs
- Ownership types for flexible alias protection
- cJVM: a single system image of a JVM on a cluster
- Verification of control flow based security properties