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 br

    In this representation of Java bytecode references to a Java class file's constant pool and to attributes are replaced by direct references to the corresponding constant pool entries.

    In this representation of Java bytecode references to a Java class file's constant pool and to attributes are replaced by direct references to the corresponding constant pool entries. This facilitates developing analyses and fosters comprehension.

    Based on the fact that indirect references to constant pool entries are resolved and replaced by direct references this representation is called the resolved representation.

    This representation of Java bytecode is considered as OPAL's standard representation for writing Scala based analyses. This representation is engineered such that it facilitates writing analyses that use pattern matching.

    Definition Classes
    opalj
  • package analyses

    Defines commonly useful type aliases.

    Defines commonly useful type aliases.

    Definition Classes
    br
  • package cg
    Definition Classes
    analyses
  • AbstractClassExtensibility
  • AllEntryPointsFinder
  • AllInstantiatedTypesFinder
  • AllPackagesClosed
  • ApplicationEntryPointsFinder
  • ApplicationInstantiatedTypesFinder
  • ApplicationWithoutJREEntryPointsFinder
  • CallBySignatureKey
  • CallBySignatureTargets
  • ClassExtensibility
  • ClassExtensibilityKey
  • ClassHierarchyIsNotExtensible
  • ClosedPackages
  • ClosedPackagesConfiguration
  • ClosedPackagesKey
  • ConfigurationEntryPointsFinder
  • ConfigurationInstantiatedTypesFinder
  • ConfiguredExtensibleClasses
  • ConfiguredFinalClasses
  • DefaultClassExtensibility
  • EntryPointFinder
  • InitialEntryPointsKey
  • InitialInstantiatedTypesKey
  • InstantiatedTypesFinder
  • IsOverridableMethodKey
  • LibraryEntryPointsFinder
  • LibraryInstantiatedTypesFinder
  • MetaEntryPointsFinder
  • OpenCodeBase
  • TypeExtensibilityAnalysis
  • TypeExtensibilityKey

package cg

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. abstract class AbstractClassExtensibility extends ClassExtensibility
  2. class AllPackagesClosed extends ClosedPackages

    Treats all packages as being closed.

    Treats all packages as being closed. This analysis is useable, e.g., for simple applications which have no concept of plug-ins or a similar mechanism. In this case every package is supposed to be closed since the entire code base is available at analysis time. Generally, not useable for libraries/frameworks/code which can be "freely" extended.

    To use this analysis set the config key: org.opalj.br.analyses.cg.ClosedPackagesKey.analysis to org.opalj.br.analyses.cg.AllPackagesClosed

    Note

    An application that uses reflection to load functionality at runtime has a well-defined extension point and is not a simple application in the above sense.

  3. trait ApplicationEntryPointsFinder extends EntryPointFinder

    This trait provides an analysis to compute the entry points of a standard command-line application.

    This trait provides an analysis to compute the entry points of a standard command-line application. Please note that a command-line application can provide multiple entry points. This analysis identifies **all** main methods of the given code.

    Note

    If it is required to find only a specific main method as entry point, please use the configuration-based entry point finder.

  4. trait ApplicationInstantiatedTypesFinder extends InstantiatedTypesFinder

    This trait considers only the type java.lang.String as instantiated that is the type that is be instantiated for command line applications for their command line parameters.

  5. trait ApplicationWithoutJREEntryPointsFinder extends ApplicationEntryPointsFinder

    Similar to the ApplicationEntryPointsFinder this trait selects main methods as entry points for standard command line applications.

    Similar to the ApplicationEntryPointsFinder this trait selects main methods as entry points for standard command line applications. It excludes, however, main methods found in the Java Runtime Environment to prevent analyses of applications where the JRE is included in the project from being polluted by these entry points that are not part of the application.

  6. class CallBySignatureTargets extends AnyRef
  7. abstract class ClassExtensibility extends (ObjectType) ⇒ Answer

    Determines whether a class or interface is directly extensible by a (yet unknown) client application/library.

    Determines whether a class or interface is directly extensible by a (yet unknown) client application/library. A class/interface is directly extensible if a developer can define a direct - not transitive - subtype that is not part of the given application/library.

    This analysis uses the ClosedPackages information.

  8. class ClassHierarchyIsNotExtensible extends ClassExtensibility
  9. abstract class ClosedPackages extends (String) ⇒ Boolean

    Determines which packages are open or closed; that is, determines to which packages code - which is not yet known - can potentially be contributed to.

    Determines which packages are open or closed; that is, determines to which packages code - which is not yet known - can potentially be contributed to. In other words, a package is considered open, if a developer is allowed to define a new type within the package's namespace. If a developer cannot define a new type within the package's namespace, the package is considered closed.

    An example for closed packages are the packages within the java.* namespace of the JRE. Additionally, with Java 9 packages defined in modules can be considered closed.

    The set of open/closed packages may influence call-graph construction as well as other analyses.

    The concrete set of open/closed packages is specified in OPAL's configuration file. The relevant configuration key is: org.opalj.br.analyses.cg.ClosedPackagesKey.

    The concrete analysis which determines the open/closed packages is instantiated reflectively by ClosedPackagesKey. This facilitates the configuration of project specific closed packages. The class can be configured using the config key: org.opalj.br.analyses.cg.ClosedPackagesKey.analysis={ClosedPackagesAnalysis}

    Note

    The concept of open and closed packages - and the reason why it matters - is discussed in "Call Graph Construction for Java Libraries"

  10. class ClosedPackagesConfiguration extends ClosedPackages

    Determines the closed packages using a regular expression.

    Determines the closed packages using a regular expression.

    The regular expression can be defined using the general configuration key: org.opalj.br.analyses.cg.ClosedPackagesKey.closedPackages

    Example:
    1. org.opalj.br.analyses.cg.ClosedPackagesKey.closedPackages = "java/*|com/sun/*"

      The previous example treats all packages starting with java and com.sun as closed.

  11. trait ConfigurationEntryPointsFinder extends EntryPointFinder

    This trait provides an analysis that loads entry points from the project configuration file.

    This trait provides an analysis that loads entry points from the project configuration file.

    All entry points must be configured under the following configuration key: **org.opalj.br.analyses.cg.InitialEntryPointsKey.entryPoints**

    Example:

    org.opalj.br.analyses.cg {
        InitialEntryPointKey {
            analysis = "org.opalj.br.analyses.cg.ConfigurationEntryPointsFinder"
            entryPoints = [
              {declaringClass = "java/util/List+", name = "add"},
              {declaringClass = "java/util/List", name = "remove", descriptor = "(I)Z"}
            ]
        }
    }

    Please note that the first entry point, by adding the "+" to the declaring class' name, considers all "add" methods from all subtypes independently from the respective method's descriptor. In contrast, the second entry does specify a descriptor and does not consider List's subtypes (by not suffixing a plus to the declaringClass) which implies that only the remove method with this descriptor is considered as entry point.

  12. trait ConfigurationInstantiatedTypesFinder extends InstantiatedTypesFinder

    This trait provides an analysis that loads instantiated types from the given project configuration file.

    This trait provides an analysis that loads instantiated types from the given project configuration file.

    All instantiated types must be configured under the following configuration key: **org.opalj.br.analyses.cg.InitialInstantiatedTypesKey.instantiatedTypes**

    Example:

    org.opalj.br.analyses.cg {
        InitialInstantiatedTypesKey {
            analysis = "org.opalj.br.analyses.cg.ConfigurationInstantiatedTypesFinder"
            instantiatedTypes = [
              "java/util/List+",
              "java/util/HashSet"
            ]
        }
    }

    Please note that the first instantiated type, by adding the "+" to the class' name, considers all subtypes of List as instantiated. In contrast, the second entry does not consider any subtypes of HashSet (by not suffixing a plus to class), so only the single class is considered to be instantiated.

  13. class ConfiguredExtensibleClasses extends AbstractClassExtensibility

    Determines whether a type is directly extensible by a (yet unknown) client application/library using the base analysis ClassExtensibility and an explicitly configured list of extensible types where the list overrides the findings of the analysis.

    Determines whether a type is directly extensible by a (yet unknown) client application/library using the base analysis ClassExtensibility and an explicitly configured list of extensible types where the list overrides the findings of the analysis. This enables domain specific configurations.

    Additional configuration has to be done using OPAL's configuration file. To specify extensible classes/interfaces the following key has to be used: ClassExtensibilityKey.ConfigKeyPrefix + extensibleClasses

    Example:
    1. The following example configuration would consider java/util/Math and com/example/Type as extensible.

      org.opalj.br.analyses.cg.ClassExtensibilityKey.extensibleClasses =
          ["java/util/Math", "com/example/Type"]
  14. class ConfiguredFinalClasses extends AbstractClassExtensibility

    Determines whether a type is directly extensible by a (yet unknown) client application/library using the base analysis ClassExtensibility and an explicitly configured list of final (not extensible) types; the configuration is always considered first.

    Determines whether a type is directly extensible by a (yet unknown) client application/library using the base analysis ClassExtensibility and an explicitly configured list of final (not extensible) types; the configuration is always considered first. This enables domain specific configurations.

    Additional configuration has to be done using OPAL's configuration file. To specify classes/interfaces that are not extensible/that are final the following key has to be used: ClassExtensibilityKey.ConfigKeyPrefix + finalClasses

    Example:
    1. The following example configuration would consider java/util/Math and com/exmaple/Type as not extensible.

      org.opalj.br.analyses.cg.ClassExtensibilityKey.finalClasses =
          ["java/util/Math", "com/example/Type"]
  15. class DefaultClassExtensibility extends AbstractClassExtensibility
  16. sealed trait EntryPointFinder extends AnyRef

    The EntryPointFinder trait is a common trait for all analyses that can derive an programs entry points.

    The EntryPointFinder trait is a common trait for all analyses that can derive an programs entry points. The concrete entry point finder that is used to determines a programs entry points directly impacts the computation of a programs call graph.

    All subclasses should be implemented in a way that it is possible to chain them. (Decorator)

  17. sealed trait InstantiatedTypesFinder extends AnyRef

  18. trait LibraryEntryPointsFinder extends EntryPointFinder

    This trait provides an analysis to compute a libraries' default entry points.

    This trait provides an analysis to compute a libraries' default entry points. The analysis thus depends on the type extensibility, method overridability, and closed packages information. Hence, its behaviour and output heavily depends on the configuration settings.

    Note

    If the target program relies on frameworks with additional custom entry points, you can combine this analysis with the additional configurable entry points.

  19. trait LibraryInstantiatedTypesFinder extends InstantiatedTypesFinder

    This trait considers those types instantiated that can be instantiated by an application using the project under analysis as a library, i.e., those types that can be instantiated because they are public or inside an open package and that have a constructor that is accessible.

  20. class OpenCodeBase extends ClosedPackages

    A conservative ClosedPackages analysis which considers all packages (except of those starting with java) as being open.

    A conservative ClosedPackages analysis which considers all packages (except of those starting with java) as being open. The java.* packages are protected by the JVM itself. This analysis can safely be used by every analysis, but - depending on the context - may result in imprecise analysis results.

    To use this analysis set the config key: org.opalj.br.analyses.cg.ClosedPackagesKey.analysis to org.opalj.br.analyses.cg.OpenCodeBase

  21. class TypeExtensibilityAnalysis extends (ObjectType) ⇒ Answer

    Determines if a type (class or interface) is further (transitively) extensible by yet unknown types (that is, can be (transitively) inherited from).

    Determines if a type (class or interface) is further (transitively) extensible by yet unknown types (that is, can be (transitively) inherited from).

    Special cases

    If a class is defined in a package starting with java.*, it always has to be treated like classes that belong to a closed package. This is necessary because the default ClassLoader prevents the definition of further classes within these packages, hence, they are closed by definition.

    If the analyzed codebase has an incomplete type hierarchy, which leads to unknown subtype relationships, it is necessary to add these particular classes to the computed set of extensible classes.

Value Members

  1. object AllEntryPointsFinder extends EntryPointFinder

    The AllEntryPointsFinder considers all methods as entry points.

    The AllEntryPointsFinder considers all methods as entry points. It can be configured to consider only project methods as entry points instead of project and library methods by specifying **org.opalj.br.analyses.cg.InitialEntryPointsKey.AllEntryPointsFinder.projectMethodsOnly=true**.

  2. object AllInstantiatedTypesFinder extends InstantiatedTypesFinder

    The AllInstantiatedTypesFinder considers all class files' types as instantiated.

    The AllInstantiatedTypesFinder considers all class files' types as instantiated. It can be configured to consider only project class files instead of project and library class files by specifying **org.opalj.br.analyses.cg.InitialInstantiatedTypesKey.AllInstantiatedTypesFinder.projectClassesOnly=true**.

  3. object ApplicationEntryPointsFinder extends ApplicationEntryPointsFinder with ConfigurationEntryPointsFinder

    The ApplicationEntryPointsFinder considers all main methods plus additionally configured entry points.

  4. object ApplicationInstantiatedTypesFinder extends ApplicationInstantiatedTypesFinder with ConfigurationInstantiatedTypesFinder
  5. object ApplicationWithoutJREEntryPointsFinder extends ApplicationWithoutJREEntryPointsFinder with ConfigurationEntryPointsFinder
  6. object CallBySignatureKey extends ProjectInformationKey[CallBySignatureTargets, Nothing]

    The key object to get the interface methods for which call-by-signature resolution needs to be done.

    The key object to get the interface methods for which call-by-signature resolution needs to be done.

    Note

    To get call-by-signature information use the org.opalj.br.analyses.Project's get method and pass in this object.

    See also

    CallBySignatureResolution for further information.

  7. object ClassExtensibilityKey extends ProjectInformationKey[ClassExtensibility, Nothing]

    The key object to get a function that determines whether a type is directly extensible or not.

    The key object to get a function that determines whether a type is directly extensible or not.

    See also

    ClassExtensibility for further information.

  8. object ClosedPackagesKey extends ProjectInformationKey[ClosedPackages, Nothing]

    The key object to get a function that determines whether a package is closed or not.

    The key object to get a function that determines whether a package is closed or not. See ClosedPackages for further details.

    This key reflectively instantiates the analysis that determines whether a package is closed or not. The respective analysis has to extend the abstract ClosedPackages class. To configure which analysis is used use the key org.opalj.br.analyses.cg.ClosedPackagesKey.analysis to specify the name of the class which implements the analysis.

    Example:
    1. org.opalj.br.analyses.cg {
          ClosedPackagesKey {
              analysis = "org.opalj.br.analyses.cg.ClosedPackagesConfiguration"
              closedPackages = "java(/.*)*"
          }
      }
    Note

    Please see the documentation of ClosedPackages and its subtypes for more information.

    ,

    The default configuration is the conservative OpenCodeBase analysis.

  9. object ConfigurationEntryPointsFinder extends ConfigurationEntryPointsFinder

    The ConfigurationEntryPointsFinder considers only configured entry points.

  10. object ConfigurationInstantiatedTypesFinder extends ConfigurationInstantiatedTypesFinder
  11. object InitialEntryPointsKey extends ProjectInformationKey[Traversable[Method], Nothing]

    The key object to get a traversable of entry points.

    The key object to get a traversable of entry points. Entry points are particularly relevant to construct call graphs. See InitialEntryPointsKey for further details.

    This key reflectively instantiates the analysis that determines the program's entry points. The respective analysis has to extend the trait InitialEntryPointsKey class.

    To configure which analysis is used use the key org.opalj.br.analyses.cg.InitialEntryPointKey.analysis to specify the name of the class which implements the analysis.

    Example:
    1. org.opalj.br.analyses.cg {
          InitialEntryPointKey {
              analysis = "org.opalj.br.analyses.cg.ApplicationEntryPointFinder"
          }
      }
    Note

    Please see the documentation of EntryPointFinder and its subtypes for more information.

  12. object InitialInstantiatedTypesKey extends ProjectInformationKey[Traversable[ObjectType], Nothing]

    Creates the InstantiatedTypesFinder as specified in the ConfigKeyPrefix config key.

    Creates the InstantiatedTypesFinder as specified in the ConfigKeyPrefix config key.

    Example:
    1. org.opalj.br.analyses.cg {
          InitialInstantiatedTypesKey {
              analysis = "org.opalj.br.analyses.cg.ApplicationInstantiatedTypesFinder"
          }
      }
    Note

    Please see the documentation of InstantiatedTypesFinder and its subtypes for more information.

  13. object IsOverridableMethodKey extends ProjectInformationKey[(Method) ⇒ Answer, Nothing]

    The key object to get a function that determines whether a method can be overridden by a not yet existing type.

    The key object to get a function that determines whether a method can be overridden by a not yet existing type. A method can be overridden if it's declaring type _dt_is extensible by an (unknown) type _ut_ (e.g., when the analysis assumes an open world) and if the method is not overridden by another subtype _s_ such that _ut <: s <: st_ and if the method can be overridden according to the JVM's semantics.

  14. object LibraryEntryPointsFinder extends LibraryEntryPointsFinder with ConfigurationEntryPointsFinder

    The ApplicationEntryPointsFinder considers all main methods plus additionally configured entry points.

  15. object LibraryInstantiatedTypesFinder extends LibraryInstantiatedTypesFinder with ConfigurationInstantiatedTypesFinder
  16. object MetaEntryPointsFinder extends ApplicationEntryPointsFinder with LibraryEntryPointsFinder with ConfigurationEntryPointsFinder

    The MetaEntryPointsFinder is a conservative EntryPoints finder triggers all known finders.

  17. object TypeExtensibilityKey extends ProjectInformationKey[(ObjectType) ⇒ Answer, Nothing]

    Key to get the function that determines whether a type (i.e., we abstract over a class/ interface and all its subtypes) is extensible or not. A type is extensible if a developer could define a sub(*)type that is not part of the given application/library.

Ungrouped