Patent ID: 6925638

Claim:
A method of detecting mutability of variables, objects, fields, and classes in a program component, said component being written in an object-oriented programming language, comprising the steps of: determining whether any variable in the program component could undergo a state modification of a first type, said first type state modification being made by at least one method that is within the program component; and performing encapsulation analysis to determine whether any variable in the program component could undergo a state modification of a second type, said second type state modification being made by at least one method that is not within the program component, wherein a variable is mutable if its state ever changes after said variable is initialized, the state of said variable being its value together with a state of any referenced object, wherein an object is mutable if its state ever changes after said object is initialized, said state of said object being a set of states of all associated variables, a field is mutable if any variable corresponding to said field is mutable, and a class is mutable if any instance fields implemented by said class are mutable.