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 ai

    Implementation of an abstract interpretation (ai) framework – also referred to as OPAL.

    Implementation of an abstract interpretation (ai) framework – also referred to as OPAL.

    Please note that OPAL/the abstract interpreter just refers to the classes and traits defined in this package (ai). The classes and traits defined in the sub-packages (in particular in domain) are not considered to be part of the core of OPAL/the abstract interpreter.

    Definition Classes
    opalj
    Note

    This framework assumes that the analyzed bytecode is valid; i.e., the JVM's bytecode verifier would be able to verify the code. Furthermore, load-time errors (e.g., LinkageErrors) are – by default – completely ignored to facilitate the analysis of parts of a project. In general, if the presented bytecode is not valid, the result is undefined (i.e., OPAL may report meaningless results, crash or run indefinitely).

    See also

    org.opalj.ai.AI - Implements the abstract interpreter that processes a methods code and uses an analysis-specific domain to perform the abstract computations.

    org.opalj.ai.Domain - The core interface between the abstract interpretation framework and the abstract domain that is responsible for performing the abstract computations.

  • package domain

    This package contains definitions of common domains that can be used for the implementation of analyses.

    This package contains definitions of common domains that can be used for the implementation of analyses.

    Types of Domains

    In general, we distinguish two types of domains. First, domains that define a general interface (on top of the one defined by Domain), but do not directly provide an implementation. Hence, whenever you develop a new Domain you should consider implementing/using these domains to maximize reusability. Second, Domains that implement a specific interface (trait). In this case, we further distinguish between domains that provide a default implementation (per interface only one of these Domains can be used to create a final Domain) and those that can be stacked and basically refine the overall functionality.

    Examples

    • Domains That Define a General Interface
      • Origin defines two types which domains that provide information abou the origin of a value should consider to implement.
      • TheProject defines a standard mechanism how a domain can access the current project.
      • ...
    • Domains That Provide a Default Implementation
    • Domains That Implement Stackable Functionality
      • org.opalj.ai.domain.RecordThrownExceptions records information about all uncaught exceptions by intercepting a Domain's respective methods. However, it does provide a default implementation. Hence, a typical pattern is:
    class MyDomain extends Domain with ...
        with DefaultHandlingOfMethodResults with RecordThrownExceptions

    Thread Safety

    Unless explicitly documented, a domain is never thread-safe. The general programming model is to use one Domain object per code block/method and therefore, thread-safety is not required for Domains that are used for the evaluation of methods. However domains that are used to adapt/transfer values should be thread safe (see org.opalj.ai.domain.ValuesCoordinatingDomain for further details).

    Definition Classes
    ai
  • package l0
    Definition Classes
    domain
  • BaseDomain
  • BaseDomainWithDefUse
  • DefaultReferenceValuesBinding
  • DefaultTypeLevelDoubleValues
  • DefaultTypeLevelFloatValues
  • DefaultTypeLevelHandlingForReturnInstructions
  • DefaultTypeLevelHandlingForThrownExceptions
  • DefaultTypeLevelHandlingOfMethodResults
  • DefaultTypeLevelHandlingOfVoidReturns
  • DefaultTypeLevelIntegerValues
  • DefaultTypeLevelLongValues
  • DefaultTypeLevelReferenceValues
  • PrimitiveTACAIDomain
  • ReturnInstructionsDomain
  • SimpleTypeLevelInvokeInstructions
  • TypeCheckingDomain
  • TypeLevelDomain
  • TypeLevelDoubleValues
  • TypeLevelDynamicLoads
  • TypeLevelFieldAccessInstructions
  • TypeLevelFloatValues
  • TypeLevelIntegerValues
  • TypeLevelInvokeInstructions
  • TypeLevelLongValues
  • TypeLevelLongValuesShiftOperators
  • TypeLevelPrimitiveValuesConversions
  • TypeLevelReferenceValues
  • ZeroDomain
  • package l1

    Commonly useful methods.

    Commonly useful methods.

    Definition Classes
    domain
  • package l2
    Definition Classes
    domain
  • package tracing
    Definition Classes
    domain

package l0

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. class BaseDomain[Source] extends TypeLevelDomain with ThrowAllPotentialExceptionsConfiguration with IgnoreSynchronization with DefaultTypeLevelHandlingOfMethodResults with TheProject with TheMethod

    A complete domain that performs all computations at the type level.

    A complete domain that performs all computations at the type level.

    Note

    This domain is intended to be used for demo purposes only. Tests should create their own domains to make sure that the test results remain stable. The configuration of this domain just reflects a reasonable configuration that may change without further notice.

  2. class BaseDomainWithDefUse[Source] extends BaseDomain[Source] with RecordDefUse

    Configuration of a domain that uses the l0 domains and which also records the abstract-interpretation time control flow graph and def/use information.

    Configuration of a domain that uses the l0 domains and which also records the abstract-interpretation time control flow graph and def/use information.

    Source

    The source file's type.

  3. trait DefaultReferenceValuesBinding extends DefaultTypeLevelReferenceValues with DefaultExceptionsFactory

    Default implementation for handling reference values.

  4. trait DefaultTypeLevelDoubleValues extends DefaultSpecialDomainValuesBinding with TypeLevelDoubleValues

    Base implementation of the TypeLevelDoubleValues trait that requires that the domain's Value trait is not extended.

    Base implementation of the TypeLevelDoubleValues trait that requires that the domain's Value trait is not extended. This implementation just satisfies the basic requirements of OPAL w.r.t. the domain's computational type.

  5. trait DefaultTypeLevelFloatValues extends DefaultSpecialDomainValuesBinding with TypeLevelFloatValues

    Base implementation of the TypeLevelFloatValues trait that requires that the domain's Value trait is not extended.

    Base implementation of the TypeLevelFloatValues trait that requires that the domain's Value trait is not extended. This implementation just satisfies the basic requirements of OPAL w.r.t. the domain's computational type.

  6. trait DefaultTypeLevelHandlingForReturnInstructions extends ReturnInstructionsDomain

    Provides default implementations for a Domain's return methods that always throw an IllegalMonitorStateExceptoin.

    Provides default implementations for a Domain's return methods that always throw an IllegalMonitorStateExceptoin.

    You can mix in this trait if you are not interested in a method's return values or if you need some default implementations.

  7. trait DefaultTypeLevelHandlingForThrownExceptions extends ReturnInstructionsDomain

    Basic implementation of a Domain's abruptMethodExecution method that does nothing.

  8. trait DefaultTypeLevelHandlingOfMethodResults extends DefaultTypeLevelHandlingForThrownExceptions with DefaultTypeLevelHandlingOfVoidReturns with DefaultTypeLevelHandlingForReturnInstructions

    A Domain that does nothing if a method returns ab-/normally.

    A Domain that does nothing if a method returns ab-/normally.

    Note

    This trait's methods are generally not intended to be overridden. If you need to do some special processing just directly implement the respective method and mixin the traits that ignore the rest.

  9. trait DefaultTypeLevelHandlingOfVoidReturns extends ReturnInstructionsDomain

    Basic implementation of a Domains returnVoid method that does nothing.

  10. trait DefaultTypeLevelIntegerValues extends DefaultSpecialDomainValuesBinding with TypeLevelIntegerValues

    Base implementation of the TypeLevelIntegerValues trait that requires that the domain's Value trait is not extended. This implementation satisfies the requirements of OPAL w.r.t. the domain's computational type. Additionally, it collects information about a value's range, if possible.

    Base implementation of the TypeLevelIntegerValues trait that requires that the domain's Value trait is not extended. This implementation satisfies the requirements of OPAL w.r.t. the domain's computational type. Additionally, it collects information about a value's range, if possible.

    This domain is highly efficient as it uses a single value domain value to represents all values of the same primitive type.

    Adaptation/Reusability

    This domain does not support constraint propagation – due to its reuse of the the same instance of a DomainValue across all potential instantiations of such values – and should not be used to implement such a domain as this requires the reimplementation of basically all methods.

  11. trait DefaultTypeLevelLongValues extends DefaultSpecialDomainValuesBinding with TypeLevelLongValues

    Base implementation of the TypeLevelLongValues trait that requires that the domain's Value trait is not extended.

    Base implementation of the TypeLevelLongValues trait that requires that the domain's Value trait is not extended. This implementation just satisfies the basic requirements of OPAL w.r.t. the domain's computational type.

  12. trait DefaultTypeLevelReferenceValues extends DefaultSpecialDomainValuesBinding with TypeLevelReferenceValues

    Default implementation for handling reference values.

  13. class PrimitiveTACAIDomain extends TypeLevelDomain with ThrowAllPotentialExceptionsConfiguration with IgnoreSynchronization with DefaultTypeLevelHandlingOfMethodResults with TheMethod with RecordDefUse

    This is the most primitive domain that can be used to transform Java bytecode to the three address representation offered by OPAL, which is build upon the result of a lightweight abstract interpretation.

  14. trait ReturnInstructionsDomain extends ai.ReturnInstructionsDomain with MonitorInstructionsTracker

  15. trait SimpleTypeLevelInvokeInstructions extends MethodCallsDomain

    Most basic handling of method invocations that determines the value that is put onto the operand stack/returned by a method call based on the called method's return type.

    Most basic handling of method invocations that determines the value that is put onto the operand stack/returned by a method call based on the called method's return type.

    This implementation completely ignores exceptions and/or errors thrown by the method.

    (Linkage related exceptions are currently generally ignored.)

    Note

    By ignoring potentially thrown exceptions it may be the case that not all possible paths in a program are explored and that the overall analysis may not be sound.

  16. final class TypeCheckingDomain extends Domain with DefaultSpecialDomainValuesBinding with DefaultTypeLevelIntegerValues with DefaultTypeLevelLongValues with TypeLevelLongValuesShiftOperators with TypeLevelPrimitiveValuesConversions with DefaultTypeLevelFloatValues with DefaultTypeLevelDoubleValues with TypeLevelFieldAccessInstructions with TypeLevelInvokeInstructions with TypeLevelDynamicLoads with ThrowAllPotentialExceptionsConfiguration with IgnoreSynchronization with DefaultTypeLevelHandlingOfMethodResults with DefaultTypeLevelReferenceValues with PostEvaluationMemoryManagement with DefaultExceptionsFactory with TheMethod

    Concrete domain that can be used to compute the information required to compute the org.opalj.br.StackMapTable; that is, we precisely track the information regarding the initialization status of references.

    Concrete domain that can be used to compute the information required to compute the org.opalj.br.StackMapTable; that is, we precisely track the information regarding the initialization status of references. (This is generally not necessary for the other domains because we make the correct bytecode assumption over there and, therefore, never see an invalid usage of an uninitialized object reference.)

  17. trait TypeLevelDomain extends Domain with DefaultSpecialDomainValuesBinding with DefaultReferenceValuesBinding with DefaultTypeLevelIntegerValues with DefaultTypeLevelLongValues with TypeLevelLongValuesShiftOperators with TypeLevelPrimitiveValuesConversions with DefaultTypeLevelFloatValues with DefaultTypeLevelDoubleValues with TypeLevelFieldAccessInstructions with TypeLevelInvokeInstructions with TypeLevelDynamicLoads

    This domain performs all computations at the type level and does not track the flow of concrete values.

    This domain performs all computations at the type level and does not track the flow of concrete values. Given the very high level of abstraction, an abstract interpretation using this domain terminates quickly.

    This domain can be used as a foundation/as an inspiration for building specialized Domains. For example, it is useful to, e.g., track which types of values are actually created to calculate a more precise call graph.

  18. trait TypeLevelDoubleValues extends DoubleValuesDomain

    This partial Domain performs all computations related to primitive double values at the type level.

    This partial Domain performs all computations related to primitive double values at the type level.

    This domain can be used as a foundation to build more complex domains.

  19. trait TypeLevelDynamicLoads extends DynamicLoadsDomain

    Implements the handling of dynamic ldc/ldc_w/ldc2_w instructions at the type level.

    Implements the handling of dynamic ldc/ldc_w/ldc2_w instructions at the type level.

    (Linkage related exceptions are currently generally ignored.)

  20. trait TypeLevelFieldAccessInstructions extends FieldAccessesDomain

    Implements the handling of field access instructions at the type level.

    Implements the handling of field access instructions at the type level.

    (Linkage related exceptions are currently generally ignored.)

  21. trait TypeLevelFloatValues extends FloatValuesDomain

    This partial Domain performs all computations related to primitive float values at the type level.

    This partial Domain performs all computations related to primitive float values at the type level.

    This domain can be used as a foundation to build more complex domains.

  22. trait TypeLevelIntegerValues extends Domain

    Domain that performs computations related to integer values at the type level.

  23. trait TypeLevelInvokeInstructions extends MethodCallsHandling

    Most basic handling of method invocations that determines the value that is put onto the operand stack/returned by a method call based on the called method's signature.

    Most basic handling of method invocations that determines the value that is put onto the operand stack/returned by a method call based on the called method's signature.

    (Linkage related exceptions are currently generally ignored.)

  24. trait TypeLevelLongValues extends LongValuesDomain

    This partial Domain performs all computations related to primitive long values at the type level.

    This partial Domain performs all computations related to primitive long values at the type level.

    This domain can be used as a foundation for building more complex domains.

  25. trait TypeLevelLongValuesShiftOperators extends LongValuesDomain

    This partial Domain performs all computations related to primitive long values at the type level.

    This partial Domain performs all computations related to primitive long values at the type level.

    This domain can be used as a foundation for building more complex domains.

  26. trait TypeLevelPrimitiveValuesConversions extends PrimitiveValuesConversionsDomain

    Implementation of all primitive values conversion instructions that just use the default factory methods.

  27. trait TypeLevelReferenceValues extends GeneralizedArrayHandling with AsJavaObject

    Implements the foundations for performing computations related to reference values.

    Implements the foundations for performing computations related to reference values.

    Extending/Implementing This Domain

    The following implementation decisions need to be taken into account when inheriting from this trait:

    • By default equality of DomainValues that represent reference values is reference based. I.e., two instances of DomainValues that represent reference values are never equal. However, subclasses may implement their own strategy.
    • Instances of DomainValues are always immutable or are at least considered and treated as immutable. Every update of a value's properties creates a new value. This is a general design decision underlying OPAL and should not be changed.
    • A new instance of a DomainValue is always exclusively created by one of the factory methods. (The factory methods generally start with a capital letter and are correspondingly documented.) This greatly facilitates domain adaptability and selective customizations.
  28. trait ZeroDomain extends TypeLevelDomain with DefaultHandlingOfMethodResults with IgnoreSynchronization with TheProject with TheCode

    A complete domain that performs all computations at the type level.

    A complete domain that performs all computations at the type level.

    This domain is called the zero domain as it represents the most basic configuration that is useful for performing data-flow analyses.

    Example Usage

    class ZDomain extends { // we need the "early initializer"
         val project: SomeProject = theProject
         val code: Code = body
    } with ZeroDomain with ThrowNoPotentialExceptionsConfiguration

Value Members

  1. object BaseDomain

Ungrouped