Extracts all dependencies related to the given method.
Extracts all dependencies related to the given method.
The method's declaring class.
The method whose dependencies should be extracted.
Extracts all dependencies related to the given field.
Extracts all dependencies related to the given field.
This field's declaring class.
The field whose dependencies will be extracted.
Extracts all inter source element dependencies of the given class file (including all fields, methods, annotations,...
Extracts all inter source element dependencies of the given class file (including all fields, methods, annotations,... declared by it). I.e. it extracts all source code dependencies that start from the given class file, its fields or methods, respectively.
For each extracted dependency the respective dependencyProcessor is called.
The class file whose dependencies should be extracted.
Prints a warning that the handling of org.opalj.br.instructions.INVOKEDYNAMIC instructions is incomplete (from the point of view of the dependencies to the "real" methods) and then calls processInvokedynamicRuntimeDependencies to handle the instruction.
Prints a warning that the handling of org.opalj.br.instructions.INVOKEDYNAMIC instructions is incomplete (from the point of view of the dependencies to the "real" methods) and then calls processInvokedynamicRuntimeDependencies to handle the instruction.
The warning is only shown once.
This method should be overridden by subclasses that resolve dependencies
related to an Invokedynamic
instruction. However, in that case the
method processInvokedynamicRuntimeDependencies should be called explicitly.
Default implementation for handling Invokedynamic
instructions that only
extracts dependencies on the runtime infrastructure (e.g.
Default implementation for handling Invokedynamic
instructions that only
extracts dependencies on the runtime infrastructure (e.g. the bootstrap method
and its surrounding class, the types of its arguments and its return type).
To gain more information about invokedynamic instructions, a special subclass of DependencyExtractor must be created which overrides this method and performs deeper-going analysis on invokedynamic instructions.
Processes the given signature.
Processes the given signature.
Processing a signature means extracting all references to types that are used in the type parameters that occur in the signature.
The signature's element.
The signature whose type parameters should be analyzed.
true
if the current signature (part)
is already a part of a type parameter.
Traverses a org.opalj.br.SourceElement and identifies all dependencies between the element (org.opalj.br.ClassFile, org.opalj.br.Field or org.opalj.br.Method declaration) and any element it depends on. The kind of the dependencies that are extracted are defined by the DependencyType enumeration.
Concurrency
The
DependencyExtractor
does not perform any kind of parallelization on its own. Users of aDependencyExtractor
are expected to perform the parallelization (e.g., on the level of source elements) if desired.Thread Safety
The
DependencyExtractor
does not define any relevant state and, hence, this class is thread-safe.However, if multiple dependency extractors are executed concurrently and share the same DependencyProcessor or the same
DepencencyExtractor
is used by multiple threads concurrently, the DependencyProcessor has to be thread-safe.If the DependencyExtractor is extended it is important to delegate all creations of
,VirtualSourceElements
to the DependencyProcessor to make sure that the dependency processor can perform, e.g., some internalization.By default, self dependencies will be reported (e.g. a method that calls itself, a class that defines a field with the same type). If necessary or undesired, self dependencies can easily be filtered by a DependencyProcessor's
processDependency
method.