class ClassImmutabilityAnalysis extends FPCFAnalysis
Determines the mutability of instances of a specific class. In case the class is abstract the (implicit) assumption is made that all abstract methods (if any) are/can be implemented without necessarily/always requiring additional state; i.e., only the currently defined fields are taken into consideration. An interfaces is always considered to be immutable. If you need to know if all possible instances of an interface or some type; i.e., all instances of the classes that implement the respective interface/inherit from some class are immutable, you can query the org.opalj.fpcf.properties.TypeImmutability property.
In case of incomplete class hierarchies or if the class hierarchy is complete, but some class files are not found the sound approximation is done that the respective classes are mutable.
This analysis uses the org.opalj.fpcf.properties.FieldMutability property to determine those fields which could be final, but which are not declared as final.
TODO Discuss the case if a constructor calls an instance method which is overrideable (See Verifiable Functional Purity Paper for some arguements.)
- Alphabetic
- By Inheritance
- ClassImmutabilityAnalysis
- FPCFAnalysis
- ProjectBasedAnalysis
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new ClassImmutabilityAnalysis(project: SomeProject)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
final
def
ch: ClassHierarchy
- Definition Classes
- ProjectBasedAnalysis
-
implicit final
def
classHierarchy: ClassHierarchy
- Definition Classes
- ProjectBasedAnalysis
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
determineClassImmutability(superClassType: ObjectType, superClassInformation: EOptionP[Entity, Property], superClassMutabilityIsFinal: Boolean, lazyComputation: Boolean)(cf: ClassFile): PropertyComputationResult
Determines the immutability of instances of the given class type
t.Determines the immutability of instances of the given class type
t.- superClassType
The direct super class of the given object type
t. Can benullifsuperClassMutabilityisImmutableObject.- superClassInformation
The mutability of the given super class. The mutability must not be "MutableObject"; this case has to be handled explicitly. Hence, the mutability is either unknown, immutable or (at least) conditionally immutable.
- def doDetermineClassImmutability(e: Entity): PropertyComputationResult
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
implicit final
def
logContext: LogContext
- Definition Classes
- ProjectBasedAnalysis
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
p: Project[_]
- Definition Classes
- ProjectBasedAnalysis
-
val
project: SomeProject
- Definition Classes
- ClassImmutabilityAnalysis → ProjectBasedAnalysis
-
implicit final
val
propertyStore: PropertyStore
- Definition Classes
- FPCFAnalysis
-
final
def
ps: PropertyStore
- Definition Classes
- FPCFAnalysis
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )