Provide Sensitive Mutable Classes with Unmodifiable Wrappers
es.uniovi.reflection.analyses.cmu.obj56
We detect non-public fields that are returned by a public method, and their state may be mutated by an external client. The type of a field will be mutable by a extern client if it has a public method that may modify its state (mutators), has a mutable field which is public or returned by a public method, or has any public non-final field.Additionally, it is checked whether there exists a subclass of the field type providing an immutable wrapper to recommend using it or implementing one. In such wrapper, the mutator methods or the ones exposing the mutable fields must be overridden with implementations where the state of the object is not mutated or exposed.