Publication | Closed Access
Automatic detection of immutable fields in Java
42
Citations
20
References
2000
Year
Unknown Venue
EngineeringVerificationSoftware EngineeringSource Code AnalysisSoftware AnalysisFormal VerificationJava ComponentSystems EngineeringStatic CheckingClass VariablesData FlowRuntime VerificationStatic AnalysisFinite FieldComputer EngineeringComputer SciencePattern MatchingStatic Program AnalysisSoftware DesignData SecurityOpenworld AnalysisAutomated ReasoningProgram AnalysisSoftware TestingFormal MethodsAutomatic Detection
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.
| Year | Citations | |
|---|---|---|
Page 1
Page 1