This analysis determines which classes can never be instantiated (e.g.,
java.lang.Math).
A class is not instantiable if:
it only defines private constructors and these constructors are not called
by any static method and the class does not implement Serializable.
Note
The analysis does not take reflective instantiations into account!
,
This analysis depends on the project configuration which encodes the analysis mode.
Different analysis modes are: library with open or closed packages assumption or application
This information is relevant in various contexts, e.g., to determine
precise call graph. For example, instance methods of those objects that cannot be
created are always dead.
Usage
Use the FPCFAnalysesManagerKey to query the analysis manager of a project. You can run
the analysis afterwards as follows:
val analysisManager = project.get(FPCFAnalysisManagerKey)
analysisManager.run(InstantiabilityAnalysis)
For detailed information see the documentation of the analysis manager.
The results of this analysis are stored in the property store of the project. You can receive
the results as follows:
val theProjectStore = theProject.get(SourceElementsPropertyStoreKey)
val instantiableClasses = theProjectStore.entities { (p: Property) ⇒
p == Instantiable
}
This information is relevant in various contexts, e.g., to determine
precise call graph. For example, instance methods of those objects that cannot be
created are always dead.
This analysis determines which classes can never be instantiated (e.g.,
java.lang.Math).A class is not instantiable if:
The analysis does not take reflective instantiations into account!
,This analysis depends on the project configuration which encodes the analysis mode. Different analysis modes are: library with open or closed packages assumption or application This information is relevant in various contexts, e.g., to determine precise call graph. For example, instance methods of those objects that cannot be created are always dead.
Usage
Use the FPCFAnalysesManagerKey to query the analysis manager of a project. You can run the analysis afterwards as follows:
val analysisManager = project.get(FPCFAnalysisManagerKey) analysisManager.run(InstantiabilityAnalysis)For detailed information see the documentation of the analysis manager. The results of this analysis are stored in the property store of the project. You can receive the results as follows:
This information is relevant in various contexts, e.g., to determine precise call graph. For example, instance methods of those objects that cannot be created are always dead.