◆ ConstPropAnalysis()
◆ analyze()
This method performs constant propagation analysis on the given element. It evaluates the element using a ConstEvaluator and checks various conditions based on the type of element (CtFieldRead) and its modifiers. If the element is a CtFieldRead representing a specific key ("int#length") or has certain modifiers (static without final or non-Java library field with no modifiers), the element itself is marked as the result. If the key corresponds to a value in a predefined library, a new literal element is created with that value and set as the result. If the element represents a platform-specific field, it is also marked as the result. Otherwise, the element is evaluated using the ConstEvaluator and the result is set accordingly. The method returns an instance of ConstPropAnalysis representing the result of the analysis.
Implements ppt4j.analysis.AbstractAnalysis.
◆ getLiteral()
Retrieves the CtLiteral object from the result.
- Returns
- the CtLiteral object contained in the result
◆ isLiteral()
Checks if the result is a literal value that is not null.
- Returns
- true if the result is a literal value that is not null, false otherwise
The documentation for this class was generated from the following file: