ensure Class Hierarchy Is Transformed
This function ensures that the whole hierarchy of the given class is transformed for Lincheck analysis.
For this function, under the term class hierarchy we assume the following set of classes:
class itself;
its superclasses;
its interfaces;
its enclosing class;
transitive closure of the above.
Notably, some of these classes may not be loaded yet, and invoking the <clinit> during the analysis could cause non-deterministic behavior (the class initialization is invoked only once, while Lincheck relies on the events reproducibility). To eliminate the issue, this function also loads the class before transformation, thus, initializing it and re-transforming the class after that.
Typically, this function should be called:
before creating a new instance of the specified class;
before reading a static field of the specified class;
before calling a static method of the specified class. As such, the invocation pattern of this function mimics the JVMS initialization semantics: https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-5.html#jvms-5.5 Also, naturally, this function should be called for the top-level class under analysis.
The function should be called from an ignored section of the analysis. If the INSTRUMENT_ALL_CLASSES flag is set to true, no transformation is performed.
Parameters
The name of the class to be transformed.
Ensures that the whole hierarchy of the given class is transformed for Lincheck analysis. See the description above.
Parameters
The class to be transformed.