a stateless mapping of JVM related nodes to fundamental functions of the class hierarchy analysis.
Definition at line 16 of file JvmCompatibility.h.
|
| std::string | nameOf (Rose::Common::Analysis::FunctionKeyType key) const override |
| | returns the source name of the function represented by key.
|
| |
| std::string | nameOf (Rose::Common::Analysis::ClassKeyType key) const override |
| | returns the source name of the class represented by key.
|
| |
| bool | isAbstract (Rose::Common::Analysis::ClassKeyType key) const override |
| | returns true if the class represented by key is an abstract class.
|
| |
| bool | isPureVirtual (Rose::Common::Analysis::FunctionKeyType key) const override |
| | returns true if the class represented by key is an abstract function.
|
| |
| int | compareNames (Rose::Common::Analysis::FunctionKeyType lhs, Rose::Common::Analysis::FunctionKeyType rhs) const override |
| | compares the source name of the functions lhs and rhs.
|
| |
| int | compareFunctionsByType (Rose::Common::Analysis::FunctionKeyType lhs, Rose::Common::Analysis::FunctionKeyType rhs, bool exclReturnType=true) const override |
| | compares the canonical types of functions lhs and rhs
|
| |
| Rose::Common::Analysis::FunctionTypeRelation | haveSameOrCovariantReturn (const Rose::Common::Analysis::ClassAnalysis &classes, Rose::Common::Analysis::FunctionKeyType basId, Rose::Common::Analysis::FunctionKeyType drvId) const override |
| | tests if drvId has the same or covariant return type with respect to basId
|
| |
| void | extractFromMemoryPool (Rose::Common::Analysis::ClassAnalysis &classes) const override |
| | extracts class information from the memory pool if available
|
| |
| void | extractFromProject (Rose::Common::Analysis::ClassAnalysis &classes, Rose::Common::Analysis::ASTRootType root) const override |
| | extracts class by walking the AST rooted at root.
|
| |
| Rose::Common::Analysis::LanguageSpecificFn | languageSpecificProcessing () const override |
| | returns JVM-specific class post-processing.
|
| |
| bool | inheritedMethodsImplementVirtualBaseMethods () const override |
| | returns true: in Java a method inherited from a superclass implements an interface method of a subclass (JLS 8.4.8.1, JVMS 5.4.6).
|
| |
| bool | isInheritableImplementation (Rose::Common::Analysis::FunctionKeyType fnkey) const override |
| | returns whether an inherited method qualifies as implementation of an interface method.
|
| |
| bool | canOverride (Rose::Common::Analysis::FunctionKeyType drv, Rose::Common::Analysis::FunctionKeyType bas) const override |
| | applies the access rules of JVMS 5.4.5 to a signature match.
|
| |
| void | inheritanceEdges (Rose::Common::Analysis::ClassKeyType clkey, std::function< void(Rose::Common::Analysis::ClassKeyType, Rose::Common::Analysis::ClassKeyType, bool)> fn) const override |
| | calls the callback function fn(derived, base, isvirtual) for all direct base classes of clkey
|
| |
| Rose::Common::Analysis::DataMemberType | typeOf (Rose::Common::Analysis::VariableKeyType var) const override |
| | returns the type of a non-static data member var.
|
| |
|
| AbstractCompatibilityBridge ()=default |
| | Constructs a stateless compatibility bridge.
|
| |
|
virtual | ~AbstractCompatibilityBridge ()=default |
| | Destroys a compatibility bridge through the base type.
|
| |
| virtual void | inheritanceEdges (ClassKeyType clkey, std::function< void(ClassKeyType, ClassKeyType, bool)> fn) const =0 |
| | calls the callback function fn(derived, base, isvirtual) for all direct base classes of clkey
|
| |
| virtual bool | isAutoGeneratable (const ClassAnalysis &classes, ClassKeyType clkey, FunctionKeyType fnkey) const |
| | returns whether a function with fnkey's signature can be implicitly generated in clkey.
|
| |
| virtual std::uint32_t | languageStandard () const |
| | returns the active language standard as a C++ __cplusplus-style value when available.
|
| |
| virtual bool | isFinal (FunctionKeyType fnkey) const |
| | returns whether the virtual function fnkey cannot be overridden.
|
| |
| virtual void | explicitOverrides (const ClassAnalysis &classes, ClassKeyType cls, std::function< void(FunctionKeyType, FunctionKeyType)> fn) const |
| | reports override relations that are declared explicitly instead of being derived from names and signatures.
|
| |
| virtual bool | canOverrideInContext (const ClassAnalysis &classes, ClassKeyType drvClass, FunctionKeyType drv, ClassKeyType basClass, FunctionKeyType bas) const |
| | returns whether drv, declared in drvClass, may override bas, declared in basClass, with knowledge of the classes in between.
|
| |
| bool Rose::BinaryAnalysis::ByteCode::ClassHierarchy::JvmCompatibility::inheritedMethodsImplementVirtualBaseMethods |
( |
| ) |
const |
|
overridevirtual |
returns true: in Java a method inherited from a superclass implements an interface method of a subclass (JLS 8.4.8.1, JVMS 5.4.6).
- Returns
- true.
The common analysis pairs only methods declared by a class with methods of its ancestors, which is the C++ rule. Java adds the implied overrider:
interface I { void m(); }
class B { public void m() {} }
class C extends B implements I {}
I obj = new C();
obj.m();
With this query returning true, analyzeVirtualFunctions records B.m as an implied overrider of I.m with witness C. The same rule covers an inherited superclass method beating an interface default method. Default method specificity among interfaces is resolved by the inheritance edges between the interfaces, as for C++ abstract base classes.
Reimplemented from Rose::Common::Analysis::AbstractCompatibilityBridge.