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 - org.opalj.bi) that can be used to create arbitrary representations.
    • a library to create a one-to-one in-memory representation of Java bytecode (Bytecode Disassembler - org.opalj.da).
    • a library to convert this representation to Java class files (Bytecode Creator - org.opalj.bc).
    • a library to create a representation of Java bytecode that facilitates writing simple static analyses (Bytecode Representation - org.opalj.br).
    • a library to create a stackless, three-address code representation of Java bytecode that facilitates writing complex static analyses (Three Address Code - org.opalj.tac).
    • 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 (Dependencies Extraction - org.opalj.de) and to facilitate checking architecture definitions (Architecture Validation - org.opalj.av).
    • a library for the lightweight manipulation and creation of Java bytecode (Bytecode Assembler - org.opalj.ba).
    • a library for parsing Android packages (APK - org.opalj.apk).
    • libraries for writing static analyses using the interprocedural finite distributive subset (IFDS - org.opalj.ifds) and interprocedural distributive environment (IDE - org.opal.ide) algorithms.

    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 simple 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
  • AnalysisException
  • BasicMethodInfo
  • BasicReport
  • DeclaredFields
  • DeclaredFieldsKey
  • DeclaredMethods
  • DeclaredMethodsKey
  • FieldAccessInformation
  • FieldAccessInformationAnalysis
  • FieldAccessInformationKey
  • InconsistentProjectException
  • MethodAnalysisApplication
  • MethodDeclarationContext
  • MethodDeclarationContextOrdering
  • MethodInfo
  • ModuleDefinition
  • Project
  • ProjectBasedAnalysis
  • ProjectIndex
  • ProjectIndexKey
  • ProjectInformationKey
  • ProjectLike
  • ProjectsAnalysisApplication
  • ReportableAnalysisResult
  • StringConstantsInformationKey
  • VirtualFormalParameter
  • VirtualFormalParameters
  • VirtualFormalParametersKey
  • package android
    Definition Classes
    br
  • package cfg
    Definition Classes
    br
  • package collection
    Definition Classes
    br
  • package cp

    Implementation of classes to represent/recreate a class file's constant pool.

    Implementation of classes to represent/recreate a class file's constant pool.

    Definition Classes
    br
  • package fpcf
    Definition Classes
    br
  • package instructions

    Common instruction sequences.

    Common instruction sequences.

    Definition Classes
    br
  • package reader

    Defines convenience methods related to reading in class files.

    Defines convenience methods related to reading in class files.

    Definition Classes
    br
p

org.opalj.br

analyses

package analyses

Defines commonly useful type aliases.

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

Package Members

  1. package cg

Type Members

  1. case class AnalysisException(message: String, cause: Throwable = null) extends RuntimeException with Product with Serializable

    Exception raised while the analysis is executed.

  2. case class BasicReport(toConsoleString: String) extends ReportableAnalysisResult with Product with Serializable

    Result of some analysis that just consists of some text.

    Result of some analysis that just consists of some text.

    toConsoleString

    A string printed to the console.

  3. class DeclaredFields extends AnyRef
  4. class DeclaredMethods extends AnyRef

    The set of all org.opalj.br.DeclaredMethods (potentially used by the property store).

  5. case class FieldAccessInformation(project: SomeProject) extends Product with Serializable

    Acts as a proxy for the propertyStore, accessing FieldReadAccessInformation and FieldWriteAccessInformation.

    Acts as a proxy for the propertyStore, accessing FieldReadAccessInformation and FieldWriteAccessInformation. Should be computed outside of any FPCF phases as it cannot handle intermediate values.

  6. case class InconsistentProjectException(message: String, severity: Level = Warn) extends Exception with Product with Serializable

    Thrown when the framework determines that the project is not consistent.

  7. abstract class MethodAnalysisApplication extends ProjectsAnalysisApplication

    A small framework to implement analyses which should be executed for a given set of methods.

  8. final class MethodDeclarationContext extends Ordered[MethodDeclarationContext]

    Encapsulates the information about a non-abstract, non-static method which is not an initializer (<(cl)init>) and which is required when determining potential call targets.

    Encapsulates the information about a non-abstract, non-static method which is not an initializer (<(cl)init>) and which is required when determining potential call targets.

    Note

    A class may have -- w.r.t. a given package name -- at most one package visible method which has a specific name and descriptor combination. For methods with protected or public visibility a class always has at most one method with a given name and descriptor.

    ,

    Equality is defined based on the name, descriptor and declaring package of a method (the concrete declaring class is not considered!).

  9. case class MethodInfo[Source](source: Source, method: Method) extends Product with Serializable

    Encapsulates the source of a method.

  10. case class ModuleDefinition[Source](module: ClassFile, source: Option[Source]) extends Product with Serializable
  11. class Project[Source] extends si.Project with ProjectLike

    Primary abstraction of a Java project; i.e., a set of classes that constitute a library, framework or application as well as the libraries or frameworks used by the former.

    Primary abstraction of a Java project; i.e., a set of classes that constitute a library, framework or application as well as the libraries or frameworks used by the former.

    This class has several purposes:

    1. It is a container for ClassFiles.
    2. It directly gives access to the project's class hierarchy.
    3. It serves as a container for project-wide information (e.g., a call graph, information about the mutability of classes, constant values,...) that can be queried using org.opalj.br.analyses.ProjectInformationKeys. The list of project wide information that can be made available is equivalent to the list of (concrete/singleton) objects implementing the trait org.opalj.br.analyses.ProjectInformationKey. One of the most important project information keys is the PropertyStoreKey which gives access to the property store.

    Thread Safety

    This class is thread-safe.

    Prototyping Analyses/Querying Projects

    Projects can easily be created and queried using the Scala REPL. For example, to create a project, you can use:

    val project = org.opalj.br.analyses.Project(org.opalj.bytecode.JRELibraryFolder)

    Now, to determine the number of methods that have at least one parameter of type int, you can use:

    project.methods.filter(_.parameterTypes.exists(_.isIntegerType)).size
    Source

    The type of the source of the class file. E.g., a URL, a File, a String or a Pair (JarFile,JarEntry). This information is needed for, e.g., presenting users meaningful messages w.r.t. the location of issues. We abstract over the type of the resource to facilitate the embedding in existing tools such as IDEs. E.g., in Eclipse IResource's are used to identify the location of a resource (e.g., a source or class file.)

  12. trait ProjectBasedAnalysis extends si.ProjectBasedAnalysis

    Common super trait of all analyses that use the fixpoint computations framework.

    Common super trait of all analyses that use the fixpoint computations framework. In general, an analysis computes a org.opalj.fpcf.Property by processing some entities, e.g.: ´classes´, ´methods´ or ´fields´.

  13. class ProjectIndex extends AnyRef

    An index that enables the efficient lookup of source elements (methods and fields) given the method's/field's name and the descriptor/field type.

    An index that enables the efficient lookup of source elements (methods and fields) given the method's/field's name and the descriptor/field type. The index contains fields with public, protected, <default> and private visibility.

    Basically an index of the source elements (methods and fields) of a project.

    This index can be used, e.g., to resolve method calls based on the method's names and/or descriptors.

    To get an instance of a project index call Project.get and pass in the ProjectIndexKey object.

    See also

    FieldAccessInformation to get the information where a field is accessed.

  14. trait ProjectInformationKey[T <: AnyRef, I <: AnyRef] extends si.ProjectInformationKey[SomeProject, T, I]
  15. type ProjectInformationKeys = Seq[si.ProjectInformationKey[_ <: si.Project, _ <: AnyRef, _ <: AnyRef]]
  16. trait ProjectLike extends ClassFileRepository

    Enables project wide lookups of methods and fields as required to determine the target(s) of an invoke or field access instruction.

    Enables project wide lookups of methods and fields as required to determine the target(s) of an invoke or field access instruction.

    Note

    The current implementation is based on the correct project assumption; i.e., if the bytecode of the project as a whole is not valid, the result is generally undefined. Just one example of a violation of the assumption would be, if we have two interfaces which define a non-abstract method with the same signature and both interfaces are implemented by a third interface which does not override these methods. In this case the result of a resolveMethodReference is not defined, because the code base as a whole is not valid.

  17. abstract class ProjectsAnalysisApplication extends AnyRef

    Default command-line runner implementation for analyses to be applied to one or more projects.

    Default command-line runner implementation for analyses to be applied to one or more projects.

    Subclasses can either implement analyze, creating a ReportableAnalysisResult, or override evaluate.

  18. trait ReportableAnalysisResult extends AnyRef

    Result of analyses that can be meaningfully represented using text.

  19. type SomeProject = Project[_]

    Type alias for Projects with arbitrary sources.

  20. type StringConstantsInformation = Map[String, ArraySeq[PCInMethod]]
  21. final class VirtualFormalParameter extends AnyRef

    Explicitly models a formal parameter of a DeclaredMethod to make it possible to store it in the property store and to compute properties for it.

    Explicitly models a formal parameter of a DeclaredMethod to make it possible to store it in the property store and to compute properties for it.

    The first parameter explicitly defined by the method will have the origin -2, the second one will have the origin -3 and so on. That is, the origin of an explicitly declared parameter is always -(parameter_index + 2). The origin of the this parameter is -1.

    Note

    The computational type category of the parameters is ignored to ease the mapping.

    ,

    This encoding is also used by the default three address code representation generated using a local data-flow analysis (see org.opalj.tac.TACAI). In case of the bytecode based data-flow analysis the origin used by the analysis reflects the position of the parameter value on the tac; see org.opalj.ai.parameterIndexToValueOrigin.

  22. class VirtualFormalParameters extends AnyRef

    The set of all explicit and implicit virtual formal method parameters in a project.

    The set of all explicit and implicit virtual formal method parameters in a project. The set also contains virtual formal parameters of library methods.

Value Members

  1. object BasicMethodInfo

    Defines a simplified extractor for a MethodInfo object.

  2. object BasicReport extends Serializable

    Defines factory methods for BasicReports.

  3. object DeclaredFieldsKey extends ProjectInformationKey[DeclaredFields, Nothing]
  4. object DeclaredMethodsKey extends ProjectInformationKey[DeclaredMethods, Nothing]

    The key object to get information about all declared methods.

    The key object to get information about all declared methods.

    Example:
    1. To get the index use the org.opalj.br.analyses.Project's get method and pass in this object.

    Note

    See org.opalj.br.DeclaredMethod for further details.

  5. object FieldAccessInformationAnalysis

    This analysis determines where each field is accessed.

    This analysis determines where each field is accessed.

    Usage

    Use the FieldAccessInformationKey to query a project about the field access information.

    val accessInformation = project.get(FieldAccessInformationKey)
    Note

    The analysis does not take reflective field accesses into account.

    ,

    The analysis is internally parallelized and should not be run with other analyses in parallel.

    ,

    Fields which are not accessed at all are not further considered.

  6. object FieldAccessInformationKey extends ProjectInformationKey[FieldAccessInformation, Seq[FPCFAnalysisScheduler]]

    The key object to get global field access information.

    The key object to get global field access information. Runs the EagerSimpleFieldAccessInformationAnalysis if no analyses were given in the initialization data.

    Example:
    1. To get the index use the Project's get method and pass in this object.

  7. object MethodDeclarationContext

    Definition of factory and extractor methods for MethodDeclarationContext objects.

  8. implicit object MethodDeclarationContextOrdering extends Ordering[MethodDeclarationContext]
  9. object Project

    Definition of factory methods to create Projects.

  10. object ProjectIndex

    Factory for ProjectIndex objects.

  11. object ProjectIndexKey extends ProjectInformationKey[ProjectIndex, Nothing]

    The key object to get an index of the source elements of a project.

    The key object to get an index of the source elements of a project.

    Example:
    1. To get the index use the Project's get method and pass in this object.

  12. object ProjectLike
  13. object ReportableAnalysisResult
  14. object StringConstantsInformationKey extends ProjectInformationKey[StringConstantsInformation, Nothing]

    The key object to get information about all string constants found in the project's code.

    The key object to get information about all string constants found in the project's code.

    Example:
    1. To get the index use the Project's get method and pass in this object.

  15. object VirtualFormalParameter
  16. object VirtualFormalParametersKey extends ProjectInformationKey[VirtualFormalParameters, Nothing]

    The key object to get information about all virtual formal parameters.

    The key object to get information about all virtual formal parameters.

    Example:
    1. To get the index use the org.opalj.br.analyses.Project's get method and pass in this object.

    Note

    See org.opalj.br.analyses.VirtualFormalParameter and VirtualFormalParameters for further details.

Inherited from AnyRef

Inherited from Any

Ungrouped