Packages

  • package root
    Definition Classes
    root
  • package org
    Definition Classes
    root
  • package opalj

    OPAL is a Scala-based framework for the static analysis, manipulation and creation of Java bytecode.

    OPAL is a Scala-based framework for the static analysis, manipulation and creation of Java bytecode. OPAL is designed with performance, scalability and adaptability in mind.

    Its main components are:

    • a library (Common) which provides generally useful data-structures and algorithms for static analyses.
    • a framework for implementing lattice based static analyses (Static Analysis Infrastructure)
    • a framework for parsing Java bytecode (Bytecode Infrastructure) that can be used to create arbitrary representations.
    • a library to create a one-to-one in-memory representation of Java bytecode (Bytecode Disassembler).
    • a library to create a representation of Java bytecode that facilitates writing simple static analyses (Bytecode Representation - org.opalj.br).
    • a scalable, easily customizable framework for the abstract interpretation of Java bytecode (Abstract Interpretation Framework - org.opalj.ai).
    • a library to extract dependencies between code elements and to facilitate checking architecture definitions.
    • a library for the lightweight manipulation and creation of Java bytecode (Bytecode Assembler).

    General Design Decisions

    Thread Safety

    Unless explicitly noted, OPAL is thread safe. I.e., the classes defined by OPAL can be considered to be thread safe unless otherwise stated. (For example, it is possible to read and process class files concurrently without explicit synchronization on the client side.)

    No null Values

    Unless explicitly noted, OPAL does not null values I.e., fields that are accessible will never contain null values and methods will never return null. If a method accepts null as a value for a parameter or returns a null value it is always explicitly documented. In general, the behavior of methods that are passed null values is undefined unless explicitly documented.

    No Typecasts for Collections

    For efficiency reasons, OPAL sometimes uses mutable data-structures internally. After construction time, these data-structures are generally represented using their generic interfaces (e.g., scala.collection.{Set,Map}). However, a downcast (e.g., to add/remove elements) is always forbidden as it would effectively prevent thread-safety.

    Assertions

    OPAL makes heavy use of Scala's Assertion Facility to facilitate writing correct code. Hence, for production builds (after thorough testing(!)) it is highly recommend to build OPAL again using -Xdisable-assertions.

    Definition Classes
    org
  • package de

    Functionality to extract dependencies between class files.

    Functionality to extract dependencies between class files.

    Definition Classes
    opalj
  • DependencyCollectingDependencyProcessor
  • DependencyCountingDependencyProcessor
  • DependencyExtractor
  • DependencyProcessor
  • DependencyProcessorAdapter
  • DependencyProcessorDecorator
  • DependencyStore
  • DependencyStoreKey
  • DependencyStoreWithoutSelfDependenciesKey
  • DependencyTypes
  • FilterSelfDependencies
c

org.opalj.de

DependencyExtractor

class DependencyExtractor extends AnyRef

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 a DependencyExtractor 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.

Source
DependencyExtractor.scala
Note

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.

,

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.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DependencyExtractor
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new DependencyExtractor(dependencyProcessor: DependencyProcessor)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  6. val dependencyProcessor: DependencyProcessor
    Attributes
    protected[this]
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  15. def process(declaringClass: VirtualClass, method: Method): Unit

    Extracts all dependencies related to the given method.

    Extracts all dependencies related to the given method.

    declaringClass

    The method's declaring class.

    method

    The method whose dependencies should be extracted.

    Attributes
    protected
  16. def process(declaringClass: VirtualClass, field: Field): Unit

    Extracts all dependencies related to the given field.

    Extracts all dependencies related to the given field.

    declaringClass

    This field's declaring class.

    field

    The field whose dependencies will be extracted.

    Attributes
    protected
  17. def process(classFile: ClassFile): Unit

    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.

    classFile

    The class file whose dependencies should be extracted.

  18. def processDependency(source: VirtualSourceElement, target: Type, dType: DependencyType): Unit
    Attributes
    protected[this]
  19. def processDependency(source: VirtualSourceElement, target: ArrayType, dType: DependencyType): Unit
    Attributes
    protected[this]
    Annotations
    @inline()
  20. def processDependency(source: VirtualSourceElement, target: BaseType, dType: DependencyType): Unit
    Attributes
    protected[this]
    Annotations
    @inline()
  21. def processDependency(source: VirtualSourceElement, target: ObjectType, dType: DependencyType): Unit
    Attributes
    protected[this]
    Annotations
    @inline()
  22. def processDependency(source: ClassFile, target: ObjectType, dType: DependencyType): Unit
    Attributes
    protected[this]
    Annotations
    @inline()
  23. def processDependency(source: ClassFile, target: VirtualSourceElement, dType: DependencyType): Unit
    Attributes
    protected[this]
  24. def processDependency(source: ObjectType, target: VirtualSourceElement, dType: DependencyType): Unit
    Attributes
    protected[this]
  25. def processInvokedynamic(declaringMethod: VirtualMethod, instruction: INVOKEDYNAMIC): Unit

    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.

    Overriding

    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.

    Attributes
    protected[this]
  26. def processInvokedynamicRuntimeDependencies(declaringMethod: VirtualMethod, instruction: INVOKEDYNAMIC): Unit

    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).

    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.

    Attributes
    protected[this]
  27. def processSignature(declaringElement: VirtualSourceElement, signature: SignatureElement, isInTypeParameters: Boolean = false): Unit

    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.

    declaringElement

    The signature's element.

    signature

    The signature whose type parameters should be analyzed.

    isInTypeParameters

    true if the current signature (part) is already a part of a type parameter.

    Attributes
    protected
  28. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  29. def toString(): String
    Definition Classes
    AnyRef → Any
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped