Patent ID: 8141063
Filing Date: 2012-03-20
Classification: G06F

Abstract:
1. A method for the identification of reachable elements within an object-oriented application using static analysis, the method comprising: creating a representation of each class type that is comprised within an object oriented application; creating a representation of each method and field that is associated with a respective class type, wherein the method and fields comprise static and non-static methods and fields; invoking entry point of the method and field comprised within the object-oriented application; creating representations of each object that is created within code of a method that has been determined to be reachable, restricted to a single object per instantiation instruction within the method, or the number of created objects restricted by other means; wherein each representation of an object contains a representation of each non-static field that is associated with a respective class type, whereas object representations that represent array objects are represented as having a single field of class type matching the type of the array; maintaining a record of static fields, static methods, and non-static methods within class representations that have been reached, and a record of non-static fields within object representations that have been reached; maintaining a list of object representations within each reachable static method and non-static method, each reachable static field that resides within each class representation, and each non-static field that resides within each object representation, wherein the object representations that have been passed to the method and field representations are added to this list; determining within each reachable method within class and object representations the additional field and method representations that are reachable by analyzing the methods and fields accessed by the code of the method, wherein non-static fields and methods are reachable only if accessed by the code and additionally, when an instance of a class type that declares that method or field is present within the list of object representations that is owned by the method being analyzed, and wherein static methods and fields are reachable if accessed by the code; and passing objects from methods to their reachable fields, from fields to their reachable methods, and from methods to their reachable methods, wherein objects are passed as determined by instructions within the code of the methods; wherein an object can be passed to a field only when the object type is an instance of a field's type, an object can be passed to a method when the object type is an instance of a method's parameter type, an object can be passed to an invoked non-static method if the object type is an instance of the type declaring the method, and an object can be passed from a method back to an invoking method when an object type is an instance of a method's return type and the object can be thrown as an exception object.